en

HTTP status codes are three-digit numbers that a server returns at the start of every HTTP response to tell the client the result of the request: success, a redirection or an error.

Why status codes matter

The code itself arrives in the status line, while the details come in the HTTP headers. From it the client knows what to do next: render the page, follow a new address or report an error. For example, a successful response to a GET is 200 OK, and after a POST that creates a resource the server returns 201 Created.

The five code classes

The first digit sets the class of the response:

  • 1xx — informational: the request was received and processing continues.
  • 2xx — success: 200 OK, 201 Created, 204 No Content.
  • 3xx — redirection: 301 (permanent) and 302 (temporary).
  • 4xx — client error: 404 Not Found, 403 Forbidden, 401 Unauthorized.
  • 5xx — server error: 500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable.

A 5xx code is often returned by a reverse proxy when the application behind it is unavailable, while 3xx redirects are commonly used to move a site onto HTTPS.

HTTP status codes — response result classes
Learn more

Tag cloud