HTTP Status Code is a 3-digit Code used to indicate the Status of an HTTP response
- From 100 to 199
- Success. 200-299
- 300-399 Redirection
- 400-499 Client error
- 500-599 Server error
100 to 199 messages
- 100: The server has received the request header and the requester should continue making the request. The server returns this code to indicate that it has received the first part of the request and is waiting for the rest
- 101: switching protocol. The server switches protocols based on client requests.
200 to 299 Succeeded
- 200: The request was successfully processed. The presence of this status code indicates normal status
- 201: The request succeeds and the server creates a new resource
- 202: The server has accepted the request but has not yet processed it
- 203: Unauthorized information. The request succeeded. The meta information returned is not the original server, but a copy
- 204: The server successfully processed the request, but returned no content
- 205: Resets the content. The server is successful, and the user end (for example, browser) should reset the document view
- 206: The server successfully processed some GET requests
300 to 399 Redirection
This type of status code indicates that the client needs to take further action to complete the request. Typically, these status codes are used for redirection, and subsequent request addresses (redirect targets) are specified in the Location field of this response. The user browser can automatically submit the required subsequent requests without user intervention if and only if the subsequent requests are made using a GET or HEAD method.
The client should automatically monitor the infinite loop redirection (for example, A->A, or A->B->C->A), because this results in A lot of unnecessary resource consumption on the server and client. As recommended by the HTTP/1.0 specification, browsers should not automatically access redirects more than five times.
- 300: The server can perform multiple operations on a request. The server can select an operation based on the requester or provide a list of operations for the requester to select
- 301: The requested resource has been permanently moved to the new location. When the server returns this response (a response to a GET or HEAD request), it automatically forwards the requester to the new location.
- 302: Temporary move. Similar to 301. But resources are moved only temporarily. The client should continue to use the original URI
- 303: View other addresses. Similar to 301. Use GET and POST requests to view
- 304: The requested resource has not been modified since the last request. When the server returns this response, it does not return the content of the resource, thus saving bandwidth and overhead
- 305: The requester can only access the requested web page using a proxy. If the server returns this response, it also indicates that the requester should use a proxy
- 307: temporary redirect. Similar to 302. Use GET to request redirection
An error occurs on the 400 to 499 client
- 400: The server does not understand the request syntax
- 401: The request requires authentication. The server may return this response for a web page that requires login
- 403: The server rejected the request
- 404: The server cannot find the requested resource. For example, this code is often returned for resources that do not exist on the server
- 405: METHOD not allowed in request (HTTP METHOD)
- 406: The request is unacceptable because the content characteristics of the requested resource do not meet the conditions in the request header and therefore cannot generate a response entity
- 407: The request requires the identity of the broker, similar to the 401, but the requester should use the broker for authorization
- 408: The server timed out while waiting for the request
- 409: Request could not be completed due to conflict with the current state of the requested resource
- 410: The server returns this response if the requested resource has been permanently deleted
- 411: The server cannot process the content-length message sent by the client
- 412: The server does not meet one of the prerequisites set by the requester in the request
- 413: The server cannot process the request because the request entity is too large for the server to handle
- 414: The request URI (usually a web address) is too long for the server to process
- 415: The format of the request is not supported by the request page
- 416: If the page cannot provide the requested scope, the server returns this status code
- 417: The server does not satisfy the “Expect” request header field requirement
- 429: The user sent too many requests in a given amount of time. Designed for network speed limitation
- 431: The server is reluctant to process the request because one or more header fields are too large
500 to 599 Server errors occur
- 500: The server encountered an error and could not complete the request
- 501: The server did not support the requested functionality and could not complete the request
- 502: Server acting as gateway or proxy receives invalid response from upstream server
- 503: The server is currently unavailable (due to overloading or downtime for maintenance). Usually, this is a temporary state
- 504: The server acts as a gateway or proxy, but does not receive requests from the upstream server in time
- 505: The server does not support the HTTP version of the request and cannot complete the processing
Excerpts from:
- Cats teach you HTTP status codes
- The HTTP status code