HTTP detailed t...login
HTTP detailed tutorial
author:php.cn  update time:2022-04-11 13:41:55

HTTP status code


When a visitor visits a web page, the viewer's browser will make a request to the server where the web page is located. Before the browser receives and displays the web page, the server where the web page is located will return a server header containing an HTTP status code to respond to the browser's request.

The English name of HTTP status code is HTTP Status Code.

The following are common HTTP status codes:

  • 200 - The request was successful

  • 301 - The resource (web page, etc.) was Permanent transfer to other URL

  • 404 - The requested resource (web page, etc.) does not exist

  • 500 - Internal server error

HTTP status code classification

HTTP status code consists of three decimal digits. The first decimal digit defines the type of status code. The last two digits have no classification role. HTTP status codes are divided into 5 types:

HTTP status code classification
CategoryCategory description
1**Information, the server received the request and needs the requester to continue performing the operation
2**Success , the operation was successfully received and processed
3**Redirect, further action is required to complete the request
4**Client error, the request contains a syntax error or the request cannot be completed
5**Server error, the server is processing the request An error occurred during the process

HTTP status code list:

##200OKThe request was successful. Generally used for GET and POST requests 201Created has been created. Successfully requested and created a new resource202AcceptedAccepted. The request has been accepted but has not been processed203Non-Authoritative InformationNon-authorized information. The request was successful. But the meta information returned is not on the original server, but a copy204No ContentNo content. The server processed successfully, but no content was returned. Ensures that the browser continues to display the current document without updating the web page205Reset ContentReset content. Server processing is successful and the user terminal (e.g. browser) should reset the document view. This return code can be used to clear the browser's form field206Partial Contentpartial content. The server successfully processed part of the GET request300Multiple Choices多choice. The requested resource may include multiple locations, and accordingly a list of resource characteristics and addresses may be returned for user terminal (e.g. browser) selection301Moved PermanentlyMove permanently. The requested resource has been permanently moved to the new URI, the return information will include the new URI, and the browser will automatically be directed to the new URI. Any new requests in the future should use the new URI instead of 302Found Temporarily Moved. Similar to 301. But the resource is only moved temporarily. The client should continue to use the original URI##303304305306307#
HTTP status code list
Status codeStatus code English nameChinese description
100ContinueContinue. The client should proceed with its request
101Switching Protocols Switching protocols. The server switches protocols based on the client's request. You can only switch to a higher-level protocol, for example, switch to a new version of HTTP protocol


See Other to view other addresses. Similar to 301. Use GET and POST requests to view
Not ModifiedNot modified. The requested resource has not been modified. When the server returns this status code, no resource will be returned. Clients typically cache accessed resources by providing a header indicating that the client wishes to return only resources modified after a specified date
Use ProxyUse a proxy. The requested resource must be accessed through a proxy
UnusedDeprecated HTTP status code
Temporary RedirectTemporary redirection. Similar to 302. Redirect using GET request
400Bad RequestThe syntax of the client request is incorrect and the server cannot understand it
401 UnauthorizedThe request requires the user’s identity authentication
402Payment RequiredReserved for future use
403ForbiddenThe server understands the request from the client, but refuses to execute the request
404Not FoundThe server cannot find the resource (webpage) according to the client's request. With this code, website designers can set up a personalized page that says "The resource you requested could not be found"
405Method Not AllowedCustomers The method in the client request is prohibited
406Not AcceptableThe server cannot complete the request based on the content characteristics of the client request
407Proxy Authentication RequiredThe request requires proxy authentication, similar to 401, but the requester should use the proxy for authorization
408Request Time-outThe server waited too long for the request sent by the client and timed out
409ConflictThe server may return this code when completing the client's PUT request. A conflict occurred when the server processed the request
410GoneThe resource requested by the client no longer exists. 410 is different from 404. If the resource has been permanently deleted, the 410 code can be used. The website designer can specify the new location of the resource through the 301 code
411 Length RequiredThe server cannot process the request information sent by the client without Content-Length
412Precondition Failed Prerequisite error for client request information
413Request Entity Too LargeRejected because the requested entity is too large and cannot be processed by the server ask. To prevent continued requests from the client, the server may close the connection. If it is just that the server cannot process it temporarily, it will contain a Retry-After response message
414Request-URI Too LargeRequested URI Too long (URI is usually a URL) and the server cannot handle it
415Unsupported Media TypeThe server cannot process the media format attached to the request
416Requested range not satisfiableThe range requested by the client is invalid
417Expectation FailedThe server cannot satisfy the Expect request header information

500Internal Server Error Server internal error, unable to complete the request
501Not ImplementedThe server does not support the requested function and cannot complete the request
502Bad GatewayActs The gateway or proxy server received an invalid request from the remote server
503Service UnavailableDue to overload or system maintenance, the server Temporarily unable to process the client's request. The length of the delay can be included in the server's Retry-After header information
504Gateway Time-outServer acting as a gateway or proxy , the request was not obtained from the remote server in time
505HTTP Version not supportedThe server does not support the requested HTTP protocol version and cannot be completed deal with

php.cn