A status code
- The HTTP status code is responsible for representing the return result of the CLIENT HTTP request, marking whether the server processing is normal, and notifying the occurrence of errors.
- A status code consists of three digits and a reason phrase
- Category of the status code
2 2 xx success
-
The 200 OK request from the client is processed normally on the server
-
204 No Content The request was processed successfully, but there are No resources to return
-
206 Partial Content The Partial Content client made a scope request, and the server successfully executed that part of the GET request
Three 3XX redirection
-
301 Moved Permanently Redirected Permanently. This status code indicates that the requested resource has been assigned a new URI and that the URI to which the resource now refers should be used later.
-
302 Found Temporary redirect. This status code indicates that the requested resource has been assigned a new URI and is expected to be accessed by the user using the new URI. Similar to 301 Moved Permanently, but the resource represented by the 302 status code is not Permanently Moved, but only temporarily. In other words, the URI of a resource that has been moved may change in the future.
-
303 See Other This status code indicates that the resource corresponding to the request has another URI, so the GET method should be used to obtain the requested resource. The 303 status code has the same functionality as the 302Found status code, but differs from the 302 status code in that the 303 status code explicitly states that the client should use the GET method to obtain the resource. When the 301,302,303 response status code is returned, almost all browsers change POST to GET and remove the body from the request message, after which the request is automatically sent again. 301, the 302 standard forbids changing the POST method to GET, but in practice everyone does it.
-
304 Not Modified The status code indicates that when the client sends a conditional request (conditional request refers to the request packet using the GET method that contains if-match, if-modified-since, if-none-match, if-range, and if-unmodified-since), The server allows the request to access the resource, but returns 304 Not Modified if the condition is Not met. The 304 status code returned does not contain any response body. Although 304 is classified as 3XX, it has nothing to do with redirection.
-
307 Temporary Redirect Temporary redirection. The status code has the same meaning as 302 Found. Although the 302 standard forbids the conversion of POST to GET, it is not followed in practice. 307 will comply with browser standards and will not change from POst to GET. However, each browser may differ in how it behaves when handling the response.
4 4XX client error
-
400 Bad Request Syntax errors exist in the Request packet. When an error occurs, you need to modify the content of the request and send the request again. In addition, the browser treats the status code as if it were 200 OK.
-
401 Unauthorized The status code indicates that the request to be sent requires authentication information that is authenticated through HTTP. In addition, if the request has been made once before, the user authentication fails. Returns with 401 must contain a WWW-Authenticate header applicable to the requested resource to challenge user information. When the browser receives the 401 response for the first time, an authentication dialog will pop up.
-
403 Forbidden The status code indicates that the access to the requested resource is denied by the server. It is not necessary for the server to give a detailed reason for the rejection, but if it is desired, the reason can be described in the body of the entity so that the user can see it. The reasons for 403 May be that the file system is not authorized to access the file system, or that the access permission is incorrect (an unauthorized sending source IP address attempts to access the file system).
-
404 Not Found The requested resource could Not be Found on the server. In addition, it can be used when the server rejects the request without giving a reason.
5 A 5XX server error occurs
-
500 Internal Server Error An Error occurred when the Server executed the request. It could also be a Web application bug or some temporary glitch.
-
503 Service Unavailable This status code indicates that the server is temporarily overloaded or undergoing maintenance downtime and cannot process requests. If you know in advance how long it will take to resolve the above situation, it is best to write the retry-after header field and return it to the client.