When a viewer visits a web page, the viewer's browser will send a request to the server where the web page is located. Before the browser receives and displays the webpage, the server where the webpage is located will return an information header (server header) containing the HTTP status code in response to the browser's request.
The English of HTTP status code is HTTP Status Code .
The following are common HTTP status codes:
- 200 - request successful
- 301 - The resource (webpage, etc.) has been permanently moved to another URL
- 404 - The requested resource (page, etc.) does not exist
- 500 - Internal Server Error
Classification of HTTP status codes
HTTP status codes consist of three decimal digits, the first decimal digit defines the type of status code. Responses are divided into five categories: Informational Responses (100–199), Successful Responses (200–299), Redirects (300–399), Client Errors (400–499), and Server Errors (500–599):
Classification | Category description |
---|---|
1** | Information, the server receives the request and needs the requester to continue to perform the operation |
2** | Success, the operation was successfully received and processed |
3** | Redirected, further action is required to complete the request |
4** | Client error, the request contained syntax errors or could not be completed |
5** | Server error, the server encountered an error while processing the request |
List of HTTP status codes:
status code | English name of status code | Chinese description |
---|---|---|
100 | Continue | continue. The client should proceed with its request |
101 | Switching Protocols | Switch protocol. The server switches protocols at the client's request. Can only switch to a higher-level protocol, for example, switch to a new version of the HTTP protocol |
200 | OK | The request was successful. Generally used for GET and POST requests |
201 | Created | created. Successfully requested and created a new resource |
202 | Accepted | accepted. The request has been accepted but not completed |
203 | Non-Authoritative Information | Unauthorized information. The request was successful. But the returned meta information is not in 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 if the web page is not updated |
205 | Reset Content | Reset content. The server processing is successful, and the user terminal (eg: browser) should reset the document view. The browser's form field can be cleared by this return code |
206 | Partial Content | Part. The server successfully processed a partial GET request |
300 | Multiple Choices | multiple choices. The requested resource can include multiple locations, and a list of resource characteristics and addresses can be returned for user terminal (eg: browser) selection |
301 | Moved Permanently | Move permanently. The requested resource has been permanently moved to the new URI, the returned information will include the new URI, and the browser will automatically be directed to the new URI. Any future requests should use the new URI instead |
302 | Found | Temporary move. Similar to 301. But the resources are only moved temporarily. Clients should continue to use the original URI |
303 | See Other | View other addresses. Similar to 301. View using GET and POST requests |
304 | Not Modified | unmodified. The requested resource has not been modified. When the server returns this status code, no resource will be returned. Clients usually cache accessed resources by providing a header indicating that the client wishes to return only resources modified after a specified date |
305 | Use Proxy | Use a proxy. The requested resource must be accessed through a proxy |
306 | Unused | Deprecated HTTP status codes |
307 | Temporary Redirect | Temporary redirection. Similar to 302. Redirect with GET request |
400 | Bad Request | The syntax of the client request is wrong, the server cannot understand it, and the common parameter is wrong |
401 | Unauthorized | The request requires the user's identity authentication, usually the token verification fails |
402 | Payment Required | reserved for future use |
403 | Forbidden | The server understands the request from the client, but refuses to execute the request (it can be understood as having no authority) |
404 | Not Found | The server was unable to find the resource (web page) requested by the client. This code allows website designers to set up a "The resource you requested could not be found" personality page |
405 | Method Not Allowed | Method forbidden in client request |
406 | Not Acceptable | The server was unable to complete the request based on the content characteristics requested by the client |
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 it completes the client's PUT request. A conflict occurred while the server was processing 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 before, 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 | Bad prerequisites for client request information |
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 the client, the server may close the connection. If the server is temporarily unable to process it, it will contain a Retry-After response message |
414 | Request-URI Too Large | The requested URI is too long (URI is usually a URL), and the server cannot handle it |
415 | Unsupported Media Type | The server cannot handle the media format attached to the request |
416 | Requested range not satisfiable | The scope requested by the client is invalid |
417 | Expectation Failed | The server cannot satisfy the request header information of Expect |
500 | Internal Server Error | Internal server error, unable to complete request |
501 | Not Implemented | The server does not support the requested feature and cannot complete the request |
502 | Bad Gateway | An invalid response was received from the remote server when the server acting as a gateway or proxy attempted to fulfill the request |
503 | Service Unavailable | Due to overload or system maintenance, the server is temporarily unable to process the client's request. The length of the delay can be included in the server's Retry-After header |
504 | Gateway Time-out | The server acting as a gateway or proxy did not get the request from the remote server in time |
505 | HTTP Version not supported | 服务器不支持请求的HTTP协议的版本,无法完成处理 |