In HTTP, status codes are a machine-readable mechanism indicating the result of a previously issued request. From RFC 7231, sec. 6: "The status-code element is a three-digit integer code giving the result of the attempt to understand and satisfy the request."
The formal grammar allows codes to be anything between
999. However, only the range from
599 has assigned meaning.
HTTP/1.1 defines a number of numeric HTTP status codes that appear in the status line - the first line of an HTTP response - to summarise what the client should do with the response.
The first digit of a status codes defines the response’s class:
2xxClient request successful
3xxRequest redirected - further action necessary, such as a new request
4xxClient error - do not repeat the same request
5xxServer error - maybe try again
In practice, it is not always easy to choose the most appropriate status code.