Responses

Status code families

Use the first digit of an HTTP status code to quickly distinguish information, success, redirection, client errors, and server errors.

6 minute lesson

~~~

HTTP status codes are grouped into five families:

  • 1xx: the exchange is still in progress.
  • 2xx: the request succeeded.
  • 3xx: another location or a cached response is involved.
  • 4xx: the request cannot be fulfilled as sent.
  • 5xx: the server failed while handling a valid request.

The family gives you a useful first diagnosis. A 404 and a 401 mean different things, but both tell you to investigate the request or client context. A 500 points you toward server logs instead.

Do not treat every non-200 response as failure. 201, 204, 301, and 304 can all be correct outcomes.

Lesson completed