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
Category Category 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:

##200 OK The request was successful. Generally used for GET and POST requests 201 Created has been created. Successfully requested and created a new resource 202 Accepted Accepted. The request has been accepted but has not been processed 203 Non-Authoritative Information Non-authorized information. The request was successful. But the meta information returned is not on the original server, but a copy 204 No Content No content. The server processed successfully, but no content was returned. Ensures that the browser continues to display the current document without updating the web page 205 Reset Content Reset 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 field 206 Partial Content partial content. The server successfully processed part of the GET request 300 Multiple 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) selection 301 Moved Permanently Move 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 302 Found Temporarily Moved. Similar to 301. But the resource is only moved temporarily. The client should continue to use the original URI ##303 304 305 306 307 #
HTTP status code list
Status code Status code English name Chinese description
100 Continue Continue.The clientshould proceed with its request
101 Switching 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 Modified Not 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 Proxy Use a proxy. The requested resource must be accessed through a proxy
Unused Deprecated HTTP status code
Temporary Redirect Temporary redirection. Similar to 302. Redirect using GET request
400 Bad Request The syntax of the client request is incorrect and the server cannot understand it
401 Unauthorized The request requires the user’s identity authentication
402 Payment Required Reserved for future use
403 Forbidden The server understands the request from the client, but refuses to execute the request
404 Not Found The 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"
405 Method Not Allowed Customers The method in the client request is prohibited
406 Not Acceptable The server cannot complete the request based on the content characteristics of the client request
407 Proxy Authentication Required The request requires proxy authentication, similar to 401, but the requester should use the proxy for authorization
408 Request Time-out The server waited too long for the request sent by the client and timed out
409 Conflict The server may return this code when completing the client's PUT request. A conflict occurred when the server processed the request
410 Gone The 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 Required The server cannot process the request information sent by the client without Content-Length
412 Precondition Failed Prerequisite error for client request information
413 Request Entity Too Large Rejected 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
414 Request-URI Too Large Requested URI Too long (URI is usually a URL) and the server cannot handle it
415 Unsupported Media Type The server cannot process the media format attached to the request
416 Requested range not satisfiable The range requested by the client is invalid
417 Expectation Failed The server cannot satisfy the Expect request header information

500 Internal Server Error Server internal error, unable to complete the request
501 Not Implemented The server does not support the requested function and cannot complete the request
502 Bad Gateway Acts The gateway or proxy server received an invalid request from the remote server
503 Service Unavailable Due 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
504 Gateway Time-out Server acting as a gateway or proxy , the request was not obtained from the remote server in time
505 HTTP Version not supported The server does not support the requested HTTP protocol version and cannot be completed deal with

php.cn