preface

When a visitor visits a web page, the visitor’s browser makes a request to the server where the page is located. When the browser receives and displays a web page, the server where the web page resides returns a Server header containing an HTTP status code in response to the browser’s request.

Common status code

  • 200 – Request successful
  • 301 – Resources (web pages, etc.) are permanently transferred to another URL
  • 404 – Requested resource (web page, etc.) does not exist
  • 500 – Internal server error

HTTP status code classification

Status code category describe understand
1XX Information (Informational status code) Message, the server receives the request and requires the requester to proceed with the operation The received request is being processed
2XX Success (Success Status code) Success, the operation is received and processed successfully The request is successfully processed
3XX Redirection (Redirection status code) Redirect, requiring further action to complete the request Additional action is required to complete the request
4XX Client Error (Client Error status code) Client error, request contains syntax error or request cannot be completed The server cannot process the request
5XX Server Error Server error. The server encountered an error while processing the request The server failed to process the request

Status code starting with 1 (temporary response)

  • These status codes represent temporary responses. Clients should be prepared to receive one or more 1XX responses before receiving regular responses.
Status code describe The English name
100 To continue. The client should continue with its request Continue
100 Switch protocol. Protocols The server switches Protocols based on client requests. You can only switch to a more advanced protocol, for example, the new version of HTTP Switching Protocols

Status code starts with 2

  • This type of status code indicates that the server successfully accepted the client request
Status code describe The English name
200 (Success) The server has successfully processed the request. Typically, this means that the server has provided the requested web page. Typically used for GET and POST requests OK
201 (Created) The request was successful and a new resource was created Created
202 (Accepted) The server has accepted the request, but has not completed processing Accepted
203 (Unauthorized Information) The server has successfully processed the request, but the meta information returned is not the original server, but a copy Non-Authoritative Information
204 (No content) The server successfully processed the request, but did not return anything. No Content
205 (Reset content) The server successfully processed the request, but did not return anything. You can ensure that the browser continues to display the current document without updating the web page Reset Content
206 (Part) The server successfully processed some of the GET requests. Partial Content

Status code starting with 3

  • Indicates that the browser needs to perform some special processing to properly process the request.
Status code describe The English name
300 (multiple options) The server can perform a variety of actions on a request. The server can select an operation based on the requester (User Agent) or provide a list of operations for the requester to select. Multiple Choices
301 (Permanent move) The requested page has been permanently moved to the new location. The requested resource has been permanently moved to the new URI, the return message will include the new URI, and the browser will automatically redirect to the new URI. Any future new requests should be replaced with a new URI Moved Permanently
302 (Temporary Removal) The server currently responds to requests from web pages in different locations, but the requester should continue to use the original URL for future requests. Found
303 (View other locations) Look at other addresses. Similar to 301. Use GET and POST requests to view See Other
304 (unmodified) Unmodified. The requested resource is not modified, and the server does not return any resources when it returns this status code. Clients typically cache accessed resources by providing a header indicating that the client wants to return only resources that have been modified after a specified date Not Modified
305 (Using proxy) 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. Use Proxy
307 (Temporary redirection) The server currently responds to requests from web pages in different locations, but the requester should continue to use the original location for future requests. Temporary Redirect

Status code starts with 4

  • These status codes indicate that the request may be in error, preventing the server from processing it.
Status code describe The English name
400 (Error request) Client request syntax error, server cannot understand Bad Request
401 (Unauthorized) The request requires user authentication. The server may return this response for a web page that requires login. Unauthorized
403 (Forbidden) The server understands the request from the requesting client, but the server rejects the request. Forbidden
404 (Not found) The server could not find the resource (web page) based on the client’s request. With this code, a web designer can set up a personalized page that says “the resource you requested could not be found. Not Found
405 (Method disabled) The method in the client request is disabled Method Not Allowed
406 (Not accepted) The server could not complete the request based on the content nature of the client request Not Acceptable
407 (Agency authorization required) This status code is similar to 401 (unauthorized), but specifies that the requester should authorize the use of the agent Proxy Authentication Required
408 (Request timed out) The server waited for a request sent by the client for a long time and timed out. Procedure Request Time-out
409 (Conflict) This code may be returned when the server completes a PUT request from the client, and a conflict occurred when the server processed the request Conflict
410 (Deleted) The resource requested by the client does not exist. 410 differs from 404 in that if a resource previously had a 410 code that is now permanently deleted, the site designer can specify a new location for the resource through the 301 code Gone
411 (Effective length required) The server will not accept requests that do not contain a valid content-length header field. Length Required
412 (Conditions not met) The server did not meet one of the prerequisites that the requester set in the request. Precondition Failed
413 (Request entity too large) The request was rejected because the requested entity was too large for the server to process. To prevent continuous requests from clients, the server may close the connection. If the server is temporarily unable to process it, a retry-after response is included Request Entity Too Large
414 (Request URI too long) The request URI is too long (usually a url) for the server to process Request-URI Too Large
415 (Unsupported Media Types) The format of the request is not supported by the requested page. Unsupported Media Type
416 (Request scope does not meet requirements) If the page cannot provide the requested scope, the server returns this status code. Requested range not satisfiable
417 (not satisfied with expected value) The server did not meet the requirements for the “expected” request header field. Expectation Failed

The status code starts with 5

  • These status codes indicate that an internal error occurred while the server was trying to process the request. These errors may be server errors rather than request errors
Status code describe The English name
500 (Server internal error) The server had an internal error and could not complete the request Internal Server Error
501 (not yet implemented) The server did not support the requested functionality and could not complete the request Not Implemented
502 (Wrong gateway) The server working as a gateway or proxy received an invalid response from the remote server when attempting to execute the request. For example, the server may return this code if it does not recognize the request method. Bad Gateway
503 (Service unavailable) The server is currently unavailable (due to overloading or downtime for maintenance). Usually, this is a temporary state. Service Unavailable
504 (Gateway timeout) The server acts as a gateway or proxy, but does not receive requests from the upstream server in time. Gateway Time-out
505 (HTTP version not supported) The server does not support the HTTP protocol version used in the request. HTTP Version not supported