Headers
Headers
# File lib/rack/response.rb, line 128 def accepted?; status == 202; end
# File lib/rack/response.rb, line 129 def bad_request?; status == 400; end
# File lib/rack/response.rb, line 123 def client_error?; status >= 400 && status < 500; end
# File lib/rack/response.rb, line 150 def content_length cl = headers[CONTENT_LENGTH] cl ? cl.to_i : cl end
# File lib/rack/response.rb, line 146 def content_type headers[CONTENT_TYPE] end
# File lib/rack/response.rb, line 127 def created?; status == 201; end
# File lib/rack/response.rb, line 131 def forbidden?; status == 403; end
# File lib/rack/response.rb, line 134 def i_m_a_teapot?; status == 418; end
# File lib/rack/response.rb, line 142 def include?(header) !!headers[header] end
# File lib/rack/response.rb, line 120 def informational?; status >= 100 && status < 200; end
# File lib/rack/response.rb, line 118 def invalid?; status < 100 || status >= 600; end
# File lib/rack/response.rb, line 155 def location headers["Location"] end
# File lib/rack/response.rb, line 133 def method_not_allowed?; status == 405; end
# File lib/rack/response.rb, line 132 def not_found?; status == 404; end
# File lib/rack/response.rb, line 126 def ok?; status == 200; end
# File lib/rack/response.rb, line 137 def redirect?; [301, 302, 303, 307].include? status; end
# File lib/rack/response.rb, line 122 def redirection?; status >= 300 && status < 400; end
# File lib/rack/response.rb, line 124 def server_error?; status >= 500 && status < 600; end
# File lib/rack/response.rb, line 121 def successful?; status >= 200 && status < 300; end
# File lib/rack/response.rb, line 135 def unprocessable?; status == 422; end