Skip to content

Instantly share code, notes, and snippets.

@mtkd
Created August 9, 2010 20:24
Show Gist options
  • Save mtkd/516044 to your computer and use it in GitHub Desktop.
Save mtkd/516044 to your computer and use it in GitHub Desktop.
HTTP Response Codes in Ruby
case code
when 200; "OK"
when 201; "Created"
when 202; "Accepted"
when 203; "Non-Authoritative Information"
when 204; "No Content"
when 205; "Reset Content"
when 206; "Partial Content"
when 300; "Multiple Choices"
when 301; "Moved Permanently"
when 302; "Found"
when 303; "See Other"
when 304; "Not Modified"
when 305; "Use Proxy"
when 306; "(Unused)"
when 307; "Temporary Redirect"
when 400; "Bad Request"
when 401; "Unauthorized"
when 402; "Payment Required"
when 403; "Forbidden"
when 404; "Not Found"
when 405; "Method Not Allowed"
when 406; "Not Acceptable"
when 407; "Proxy Authentication Required"
when 408; "Request Timeout"
when 409; "Conflict"
when 410; "Gone"
when 411; "Length Required"
when 412; "Precondition Failed"
when 413; "Request Entity Too Large"
when 414; "Request-URI Too Long"
when 415; "Unsupported Media Type"
when 416; "Requested Range Not Satisfiable"
when 417; "Expectation Failed"
when 500; "Internal Server Error"
when 501; "Not Implemented"
when 502; "Bad Gateway"
when 503; "Service Unavailable"
when 504; "Gateway Timeout"
when 505; "HTTP Version Not Supported"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment