Topic

HTTP status codes

HTTP status codes are three-digit response codes that summarize how a server handled an HTTP request and what a client should do next.

At a glance

Success class
2xx
Client-error class
4xx

Overview

An HTTP response begins with a status code that groups the outcome into informational, successful, redirection, client-error, or server-error classes. The code is only one part of the response: headers and the response body can contain additional instructions or error details. Applications should distinguish transport success from application success instead of assuming every received response means the requested operation worked.

Classes communicate broad outcomes

Codes beginning with 2 generally report successful handling, 3 indicates redirection or related behavior, 4 reports a problem associated with the client request, and 5 reports that the server failed while handling an apparently valid request. Specific codes add more precise semantics within those classes.

Client behavior should match the code

A 404 response means the target resource was not found, while 401 and 403 describe different access conditions and 429 indicates rate limiting. Robust clients inspect the actual status and documented response contract rather than converting every non-200 response into the same generic failure.

Sources and review

MOOR's explanatory text is supported by the following source links.

  1. HTTP response status codes — MDN Web Docs
  2. HTTP Semantics — RFC Editor

Browse MOOR Knowledge