HTTP Status Codes The status code is composed of 3 digits and a reason phrase (such as the most common: 200 OK). The first digit indicates the response category, which is divided into five categories from 1 to 5. add: Actually, I looked up the information and found that there is also a 600 Unparseable Response Headers starting with 6 Indicates that the server did not return a response header, only the entity content was returned. It can also be regarded as a server error status code, but it is definitely not common.
The definition of the status code response category must be followed, and there is nothing wrong with the server DIYing the two numbers behind it RFC2616 (a document used to specify HTTP protocol standards) defines more than 40 types of HTTP protocols, and with extensions, the number can reach 60. However, there are only about 14 common ones. Let me talk about these 14 representative HTTP status codes. 2XX Success 200 OK This is the most common status code indicating that the request was processed normally by the server. The information returned with this status code is related to your request method. For example, for a GET request, the requested resource will be returned as the response entity, while for a HEAD request, the information only exists in the response message header, because it does not return the message entity, only the message header. 204 No Content Indicates that the request has been successfully processed, but no content is returned (there should be no content returned), that is, there is no message entity in the returned response message (in fact, there is no body part of the message entity). After the browser sends a request to the server and receives 204, the browser page will not be updated. It is generally used when only the client sends information to the server, and the server does not need to return any information to the client. 206 Partial Content Indicates that the server has completed part of the GET request (the client made a range request), and the response message contains the entity content of the range specified by Content-Range 3XX Redirect 301 Moved Permanently Permanent redirection means that the requested resource has been permanently moved to another location, that is, the resource has been assigned a new URI. The new URI should be indicated in the Location header field of the response message. As long as it is not a HEAD request, the response entity should contain a hyperlink to the new URI and a brief description. 302 Found Temporary redirection means that the requested resource has been temporarily moved to another location. The requested resource is temporarily assigned to a new URI, which is very similar to 301, except that the resource is temporarily moved and may change in the future. Similarly, the new temporary URI should be indicated in the Location header field of the response message. As long as it is not a HEAD request, the response entity should contain a hyperlink to the new URI and a brief description 303 See Other Indicates that the requested resource has another URI and should be obtained using GET. The function of 303 is the same as 302, except that 303 specifies that the client should use GET to access it. (Many browsers before HTTP/1.1 cannot understand 303, but everyone treats 302 as 303 and uses GET to request the new URI.) 304 Not Modified Indicates that when the client sends a conditional request (IF... in the GET method request message), the condition is not met and a 304 response is returned without any response body. Although 304 is classified as 3XX, it has nothing to do with redirection. 307 Temporary Redirect Temporary redirection has the same meaning as 302. Although the 302 standard prohibits POST from being changed to GET, no one listens to it. 307 will follow the standard and will not change from POST to GET, but the response behavior may be different in different browsers. 4XX Client Error 400 Bad Request Indicates that the request message has a syntax error or parameter error, the server does not understand it, the server should not submit this request again, and needs to modify the request content and send it again 401 Unauthorized Indicates that the request sent requires HTTP authentication information or that the authentication failed. The response returned 401 must contain a WWW-Authenticate header applicable to the requested resource to query the user information. When the browser first receives 401, an authentication window will pop up. 403 Forbidden Indicates that access to the requested resource has been denied by the server. The server may or may not explain this. If it wants to explain, it can describe the reason in the body of the response entity, for example, you may not have permission to access the resource. 404 Not Found It means that the server cannot find the resource you requested. It is also possible that the server does not want to give it to you and lies to you that it cannot find it (⊙ˍ⊙), and most servers use this status code in this way. 5XX Server Error 500 Internal Server Error It means that the server made an error when executing the request. It may be a bug in the web application or a temporary failure, or more likely a bug in the server source code... 503 Service Unavailable Indicates that the server is overloaded or down for maintenance and cannot process the request. If the server knows how long it will take, it will write the Retry-After header field and return it. Summarize It is possible that the returned status code and status are inconsistent, such as an internal error in the web application, but still returning 200 OK 200 OK The request was processed normally. 204 No Content The request was processed successfully, and no entity body was returned. 206 Partial Content GET range request processed successfully 301 Moved Permanently Permanent redirection, the resource has been permanently assigned a new URI 302 Found Temporary redirection, the resource has been temporarily assigned a new URI 303 See Other Temporary redirection, expecting to use GET to obtain the target 304 Not Modified The conditional request sent was not met 307 Temporary Redirect Temporary redirection, POST does not become GET 400 Bad Request The request message syntax or parameter is incorrect. 401 Unauthorized HTTP authentication is required or failed 403 Forbidden The requested resource was denied 404 Not Found The requested resource cannot be found (the server rejects it without reason) 500 Internal Server Error Server failure or web application failure 503 Service Unavailable The server is overloaded or down for maintenance The above is the full content of this article. I hope that the content of this article can be of some help to your study or work. If you have any questions, you can leave a message to communicate. |
<<: Detailed explanation of the correct way to open em in CSS
>>: An article tells you how to implement Vue front-end paging and back-end paging
MySQL download address: https://obs.cn-north-4.my...
The legend component is a commonly used component...
Pitfalls encountered during project deployment Wh...
When people are working on a backend management s...
Copy code The code is as follows: <hr style=&q...
Achieve results Implementation ideas The melting ...
background In data warehouse modeling, the origin...
1.command not found command not found 2. No such ...
Main differences: 1. Type SQL databases are prima...
Table of contents 1. Preface 2. Find two pop-up c...
Redis Introduction Redis is completely open sourc...
This article shares the specific code of React+ts...
With the popularization of 3G, more and more peop...
Preface In WEB development, we often involve cros...
MySQL database reports ERROR 1045 (28000): Access...