HTTP common status codes

1. 2XX success

200 OK
indicates that the request sent from the client was processed normally on the server side

204 No Content
means that the request received by the server has been successfully processed, but the returned response message does not contain the body part of the entity. In addition, the body of any entity is not allowed to be returned.

206 Partial Content
indicates that the client made a range request (Range), and the server successfully executed this part of the GET request. The response message contains the entity content of the range specified by Content-Range.

2. 3XX redirects

301 Moved Permanently
Permanent redirect. Indicates that the requested resource has been assigned a new URI, and the URI that the resource now refers to should be used in the future. When the server returns this response, it will automatically redirect the requester to the new location.

302 Found
is a temporary redirect. It means that the server is currently responding to requests from a page in a different location, but the requester should continue to use the original location for future requests.
HTTP1.1 is described in the introduction 302, if the client sends a non-GET After receiving the 302 status code of the server or the HEAD request, the redirection cannot be automatically initiated unless the user confirms it.
However, many browsers treat 302 as 303, and they obtain the Location field information in the header of the HTTP response message. , and initiate a GET request.
(The 301,302 standard prohibits changing the POST method to the GET method)

303 See Other
means that the server is responding to the request from a different URI and should use the GET method for that resource. It is to allow POST requests to redirect to GET requests.

304 Not Modified
indicates that the client sends a request with conditions such as If-Match/If-Modified-Since/If-None-Match/If-Range/If-Unmodified-Since, but the conditions are not met.
Generally, it is the case since the last time After the request, the requested resource has not changed, and the server will return a 304.304 status code that does not contain any response body.

307 Temporary Redirect
Temporary redirect. The description of this status code is the same as
that of 302. Since many browsers handle 302 in a non-standard way, HTTP/1.1 adds 303 and 307 to explicitly tell the client what to do.

3. 4XX Client Error

400 Bad Request
indicates that there is a syntax error in the request message.

401 Unauthorized
indicates that the sent request needs to have authentication information that has passed HTTP authentication (BASIC authentication, DIGEST authentication). If a request has been made before, it indicates that the user authentication failed.
A response containing 401 must contain a request for the requested resource. The WWW-Authenticate header field is used to challenge user information. When the browser receives a 401 response for the first time,
a dialog window for authentication will pop up.

403 Forbidden
indicates that the server rejected the request. The server can describe the reason for the rejection in the response entity (it is not required).
Usually it is to obtain access authorization to the file system, or there is some problem with the access rights (attempting to access from an unauthorized source IP address) In other cases, 403 will occur.
If the server rejects the request and does not want to explain the reason, 404 can be used instead.

404 Not Found
The server cannot find the requested URI.

4. 5XX server error

500 Internal Server Error
An error occurred on the server side while executing the request. There may be a bug or malfunction in the web application.

503 Service Unavailable
indicates that the server is temporarily overloaded or is being shut down for maintenance and cannot process the request now. 503 indicates that this is a temporary situation. If you know in advance the time needed to resolve the above situation, you can write the
Retry-After header field to return it to the client .


Reference: "Illustrated HTTP", RFC 2616

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324814694&siteId=291194637