HTTP - Status Code
About
The status code is the exit code of request returned to the client via the first line of a response.
For example:
- a file not found error is a 404 code,
- a server error is equivalent to a 5xx code.
Cheatsheet
HTTP status | When to use |
---|---|
200 to 299, inclusive | A successful response or ok status. |
301 / 302 | The page has moved to a new URL - a redirection (301, 302, 303, 307, or 308) |
4xx - an error caused by the processing of the request (request processing error) | |
401 / 403 | The page is unavailable due to permission issues. |
404 / 410 | The page is no longer available. |
5xx | Something went wrong on the server side (server error). |
xxx | Other protocols based on HTTP can define additional status codes. |
A null body status is a status that is 101, 204, 205, or 304.
A status is an integer in the range 0 to 999, inclusive.
The full list of possible status codes can be found in the HTTP specification (RFC 2616 section 10).