The status code tells the result of the request returned from the server

The status code is responsible for describing the returned request results when the client sends a request to the server. The status code lets the user know whether the server handled the request normally or if an error occurred

Figure: The status code of the response describes the processing result of the request

Category of the status code

The reason the phrase
Informational(Informational status code)
The accepted request is being processed
Success(Success Status code)
The request is successfully processed
Redirection(Redirection status code)
Additional action is required to complete the request
Client Error (Client Error status code)
The server cannot process the request
Server Error
The server failed to process the request

2 xx success
The response from 2XX indicates that the request was processed normally


Indicates that the request from the client is processed on the server
In the response message, the information returned with the status code will change depending on the method. For example, when the GET method is used, the entity of the requested resource is returned as a response. When the HEAD method is used, the entity HEAD of the requested resource is not returned as the response (that is, only the header is returned in the response, but the entity body is not returned

204 No Content

The status code indicates that the request received by the server is successfully processed, but the response packet returned does not contain the body part of the entity. Also, it is not allowed to return the body of any entity. For example, when a 204 response is returned after processing a request from the browser, the page displayed by the browser is not updated.
This is usually used when only information needs to be sent from the client to the server, and no new information content needs to be sent to the client

206 Partial Content

This status code indicates that the client made a range request and that the server successfully executed that part of the GET request. The entity containing the Range specified by Content-Range in the response message

3 xx redirection
The 3XX response results indicate that the browser needs to perform some special processing to properly handle the request

301 Moved Permanently

Permanent redirect. 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. That is, if the URI corresponding to the resource is already bookmarked, it should be saved again as indicated in the Location header field.
As shown in the request URI below, a 301 status code is generated when you forget to add a slash “/” at the end of the specified resource path

302 Found

Temporary redirection. 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. For example, the user saves the URI as a bookmark, but does not update the bookmark as if the 301 status code were present, but retains the URI of the page that returns the 302 status code

303 See Oth

This status code indicates that because another URI exists for the requested resource, the GET method should be used to GET the requested resource

The 303 status code has the same functionality as the 302 Found 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.

For example, when a CGI program is accessed using the POST method and the result is that the client is expected to redirect to another URI using the GET method, the 303 status code is returned. While the 302 Found status code can do the same thing, the 303 status code is ideal here.

304 Not Modified

This status code indicates the condition that the server allows the request to access the resource when the client sends a conditional request, but 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

4 xx to the client

400 Bad Request

The status code indicates that a syntax error exists 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 Unauthorization

The status code indicates that the request must be authenticated through HTTP (BASIC authentication or DIGEST authentication). In addition, if the user has been requested once before, the user authentication fails.

The response returned with 401 must contain a WWWAuthenticate first Challenge user information applicable to the requested resource. When the browser receives the 401 response for the first time, an authentication dialog will pop up

403 Forbidd

This status code indicates that access to the requested resource was 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

This status code indicates that the requested resource could not be found on the server. In addition, this can be enabled when the server rejects the request without giving a reason

500 Internal Server Error

This status code indicates that an error occurred on the server side while executing the request. It could also be a Web application bug or some temporary glitch.

503 Service Unavailab

This status code indicates that the server is temporarily overloaded or is down for maintenance and is unable to process requests at this time. If you know in advance how long it will take for the above situation to be resolved, you’d better write the RetryAfter header field and return it to the customer