HTTP status code
When a browser visits a web page, the browser of the viewer sends 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 a server header containing the HTTP status code to respond 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-Resources (webpages, etc.) are permanently transferred to other URLs
- 404-The requested resource (webpage, etc.) does not exist
- 500-Internal server error
HTTP status code classification
The HTTP status code is composed of three decimal digits. The first decimal digit defines the type of the status code, and the latter two digits have no classification function. There are 5 types of HTTP status codes:
classification | Classification description |
---|---|
1** | Information, the server receives the request and needs the requester to continue the operation |
2** | Success, the operation was successfully received and processed |
3** | Redirect, requires further action to complete the request |
4** | Client error, the request contains a syntax error or the request cannot 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 | carry on. The client should continue its request |
101 | Switching Protocols | Switch the protocol. The server switches the protocol according to the client's request. Can only switch to more advanced protocols, for example, switch to the new version of 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 has not been processed |
203 | Non-Authoritative Information | Non-authorized information. The request was successful. But the returned meta information is not on the original server, but a copy |
204 | No Content | No content. The server processed successfully, but did not return content. In the case of not updating the page, you can ensure that the browser continues to display the current document |
205 | Reset Content | Reset content. The server process is successful, and the user terminal (for example: browser) should reset the document view. The form field of the browser can be cleared by this return code |
206 | Partial Content | Part. The server successfully processed some GET requests |
300 | Multiple Choices | multiple choices. The requested resource can include multiple locations, and accordingly a list of resource characteristics and addresses can be returned for user terminal (for example: 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 new requests in the future should use the new URI instead |
302 | Found | Move temporarily. Similar to 301. But the resources are only temporarily moved. The client 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 | Not modified. The requested resource has not been modified. When the server returns this status code, no resource will be returned. The client usually caches the accessed resources, by providing a header information indicating that the client wants to return only the resources modified after the specified date |
305 | Use Proxy | Use a proxy. The requested resource must be accessed through a proxy |
306 | Unused | Obsolete HTTP status codes |
307 | Temporary Redirect | Temporary redirection. Similar to 302. Use GET request redirection |
400 | Bad Request | The syntax of the client request is incorrect and the server cannot understand |
401 | Unauthorized | The request requires user authentication |
402 | Payment Required | Reserved for future use |
403 | Forbidden | The server understands the request of the requesting client, but refuses to execute the request |
404 | Not Found | The server cannot find the resource (web page) according to the client's request. Through this code, the website designer can set a personalized page of "The resource you requested cannot be found" |
405 | Method Not Allowed | The method in the client request is forbidden |
406 | Not Acceptable | The server cannot 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 | 服务器等待客户端发送的请求时间过长,超时 |
409 | Conflict | 服务器完成客户端的 PUT 请求时可能返回此代码,服务器处理请求时发生了冲突 |
410 | Gone | 客户端请求的资源已经不存在。410不同于404,如果资源以前有现在被永久删除了可使用410代码,网站设计人员可通过301代码指定资源的新位置 |
411 | Length Required | 服务器无法处理客户端发送的不带Content-Length的请求信息 |
412 | Precondition Failed | 客户端请求信息的先决条件错误 |
413 | Request Entity Too Large | 由于请求的实体过大,服务器无法处理,因此拒绝请求。为防止客户端的连续请求,服务器可能会关闭连接。如果只是服务器暂时无法处理,则会包含一个Retry-After的响应信息 |
414 | Request-URI Too Large | 请求的URI过长(URI通常为网址),服务器无法处理 |
415 | Unsupported Media Type | 服务器无法处理请求附带的媒体格式 |
416 | Requested range not satisfiable | 客户端请求的范围无效 |
417 | Expectation Failed | 服务器无法满足Expect的请求头信息 |
500 | Internal Server Error | 服务器内部错误,无法完成请求 |
501 | Not Implemented | 服务器不支持请求的功能,无法完成请求 |
502 | Bad Gateway | 作为网关或者代理工作的服务器尝试执行请求时,从远程服务器接收到了一个无效的响应 |
503 | Service Unavailable | 由于超载或系统维护,服务器暂时的无法处理客户端的请求。延时的长度可包含在服务器的Retry-After头信息中 |
504 | Gateway Time-out | 充当网关或代理的服务器,未及时从远端服务器获取请求 |
505 | HTTP Version not supported | 服务器不支持请求的HTTP协议的版本,无法完成处理 |