Decoding HTTP Status Codes: A Comprehensive Guide

Home Technology Decoding HTTP Status Codes: A Comprehensive Guide

HTTP status codes are three-digit responses that a server returns in response to a client’s request, such as a browser request for a web page. These codes provide information about the success or failure of the requested operation and help in diagnosing issues. In this blog post, we will explore the various HTTP status codes and their meanings to help you better understand and troubleshoot web communications.

1xx: Informational Responses

  • 100 Continue: The server has received the request headers and the client should proceed to send the request body.
  • 101 Switching Protocols: The requester has asked the server to switch protocols and the server is acknowledging that it will do so.
  • 102 Processing (WebDAV): The server has received and is processing the request, but no response is available yet.
  • 103 Early Hints: The server is likely to send a final response with the header fields included in this informational response.

2xx: Successful Responses

  • 200 OK: The request was successful, and the server has delivered the requested data.
  • 201 Created: The request was successful, and a resource has been created as a result.
  • 202 Accepted: The request has been received but not yet acted upon.
  • 203 Non-Authoritative Information: The server successfully processed the request, but is returning information from another source.
  • 204 No Content: The server successfully processed the request, but there is no content to send in the response.
  • 205 Reset Content: The server has fulfilled the request and the user agent should reset the document view.
  • 206 Partial Content: The server is delivering only part of the resource due to a range header sent by the client.

3xx: Redirection

  • 300 Multiple Choices: There are multiple options that the client may follow.
  • 301 Moved Permanently: The URL of the requested resource has been changed permanently.
  • 302 Found: The resource has been temporarily moved to a different URI.
  • 303 See Other: The server is redirecting the user agent to a different resource, as indicated by a URI.
  • 304 Not Modified: The resource has not been modified since the last request.
  • 305 Use Proxy: The requested resource is only available through a proxy.
  • 307 Temporary Redirect: The server is sending this status code in response to a request with a request method that it does not support.
  • 308 Permanent Redirect: The resource is now permanently located at a new URI.

4xx: Client Errors

  • 400 Bad Request: The server could not understand the request due to invalid syntax.
  • 401 Unauthorized: The request lacks valid authentication credentials for the target resource.
  • 402 Payment Required: Reserved for future use.
  • 403 Forbidden: The server understood the request, but it refuses to authorize it.
  • 404 Not Found: The server cannot find the requested resource.
  • 405 Method Not Allowed: The request method is known by the server but is not supported by the target resource.
  • 406 Not Acceptable: The server cannot produce a response matching the list of acceptable values defined in the request’s headers.
  • 407 Proxy Authentication Required: The client must first authenticate itself with the proxy.
  • 408 Request Timeout: The server would like to shut down this unused connection.
  • 409 Conflict: The request could not be completed due to a conflict with the current state of the target resource.
  • 410 Gone: The target resource is no longer available at the origin server and this condition is likely to be permanent.
  • 411 Length Required: The server refuses to accept the request without a defined Content-Length.
  • 412 Precondition Failed: One or more conditions given in the request header fields evaluated to false when tested on the server.
  • 413 Payload Too Large: The server is refusing to process a request because the request payload is larger than the server is willing or able to process.
  • 414 URI Too Long: The URI provided was too long for the server to process.
  • 415 Unsupported Media Type: The media format of the requested data is not supported by the server, so the server is rejecting the request.
  • 416 Range Not Satisfiable: The range specified in the Range header field in the request can’t be satisfied by the server.
  • 417 Expectation Failed: The expectation given in the Expect request header could not be met by at least one of the inbound servers.
  • 418 I’m a teapot (RFC 2324, RFC 7168): The server refuses to brew coffee because it is a teapot.
  • 421 Misdirected Request: The request was directed at a server that is not able to produce a response.
  • 422 Unprocessable Entity (WebDAV): The server understands the content type of the request entity, but was unable to process the contained instructions.
  • 423 Locked (WebDAV): The source or destination resource of a method is locked.
  • 424 Failed Dependency (WebDAV): The method could not be performed on the resource because the requested action depended on another action and that action failed.
  • 425 Too Early: Indicates that the server is unwilling to risk processing a request that might be replayed.
  • 426 Upgrade Required: The server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol.
  • 428 Precondition Required: The origin server requires the request to be conditional.
  • 429 Too Many Requests: The user has sent too many requests in a given amount of time.
  • 431 Request Header Fields Too Large: The server is unwilling to process the request because its header fields are too large.
  • 451 Unavailable For Legal Reasons: The server is denying access to the resource as a consequence of a legal demand.

5xx: Server Errors

  • 500 Internal Server Error: The server encountered a situation it doesn’t know how to handle.
  • 501 Not Implemented: The server does not support the functionality required to fulfill the request.
  • 502 Bad Gateway: The server, while acting as a gateway or proxy, received an invalid response from the upstream server.
  • 503 Service Unavailable: The server is not ready to handle the request, usually due to maintenance or overload.
  • 504 Gateway Timeout: The server, while acting as a gateway, did not receive a timely response from the upstream server.
  • 505 HTTP Version Not Supported: The server does not support the HTTP protocol version that was used in the request message.
  • 506 Variant Also Negotiates: The server has an internal configuration error.
  • 507 Insufficient Storage (WebDAV): The method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request.
  • 508 Loop Detected (WebDAV): The server detected an infinite loop while processing the request.
  • 510 Not Extended: Further extensions to the request are required for the server to fulfill it.
  • 511 Network Authentication Required: The client needs to authenticate to gain network access.

This comprehensive list should cover all the HTTP status codes you might encounter. Understanding each code’s meaning will help in diagnosing and troubleshooting issues effectively.