HTTP Status Codes

HTTP response codes are used to indicate success, failure, and other properties about the result of an HTTP request. Regardless of the contents of an HTTP response message body, a client will act according to the response status code.

Each HTTP response is accompanied by a status code, and they are broken into five categories. Each of the response status codes is used to convey general information about the outcome of the request.

There are five primary categories of HTTP response codes, each identifiable by the first digit:

1xx: Informational

An informational response code informs the client that the request is continuing.

2xx: Success

A successful response was received, interpreted corrected, and has been accepted.

3xx: Redirection

A redirection indicates that further action needs to take place before the request is completed.

4xx: Client error

A client error indicates that the request cannot be completed because of an issue with the client, or the syntax of the request.

5xx: Server error

A server error indicates that the request is valid but cannot be completed because of an issue on the server’s side, such as a lack of available resources.

Additional status codes

In addition to the five primary categories of HTTP status codes mentioned above, the following status codes can also be encountered on the World Wide Web.

Takeaway

HTTP responses are always accompanied by an HTTP response status code. The first digit of a status code indicates the category, which often indicates whether the request succeeded or failed. Each status code can be a valuable clue when troubleshooting problems between a client and server.

Last updated: October 23, 2023