HTTP status codes can help us quickly locate problems.
HTTP status code categories
Second, specific analysis
2XX success 200 OK
Indicates that the request made by the client is processed correctly on the server.
204 no Content
This status code indicates that the request made by the client has been successfully processed, but no content needs to be returned. Content is also not allowed to return.
This function is used when only requests are sent from the client to the server and no information is returned from the server
206 Partial Content
This status code indicates that the client makes a range request (for example, the lower part of the image is requested after a power failure), the server successfully executes the GET request for the force part, and the response packet contains the entity resources in the specified range of Content-Range
3xx Redirection 301 Moved Permanently
Permanent redirection This status code indicates that the requested resource has been assigned a new address and should be requested using the current address of the resource. If you have saved the resource as a label, you should update it with the new URI prompted by the returned Location field
302 Found
Temporary redirection indicates that the requested resource has been assigned a new URI and is expected to be accessed using the new URI this time
The difference with 301 is that 302 is only temporarily transferred and may return later, only this time with a new URI
303 see Other
The URI of the requested resource has been updated and the GET method should be used to target the resource
303 has the same functionality as 302, but 303 specifies the use of the GET method to GET resources
When the 301, 302, and 303 response status codes return, almost all browsers change post to GET and delete the subject in the heat, and the request is automatically sent again
304 not modified
This status code indicates the request of the client to send an attachment. The server allows access to the resource, but the condition is not met. 304 The response does not contain the response body when the status code is returned. For example, if the cache is not expired, the request will return 304
307 Temporary Redirect
Temporary redirects are similar to 302, except that 307 follows browser standards and rerequests do not change from POST to GET, but in practice each browser will have a different situation
4XX Client error 400 Bad Request
This status indicates that there is a syntax error in the requested packet
401 Unauthority
The status code indicates that the sent request requires authentication information authenticated through HTTP. If the request has been authenticated once before, the authentication fails
403 Forbidden
This status code indicates that the resource request is rejected by the server. The server does not need to give the reason for the rejection
For example (no access to the file system, some access problem), 403 will appear
404 Not Found
The status code indicates that the requested path was not found on the server. It may also be used when the server rejects the request and does not want to explain why.
5XX server error 500 Internet Server error
An error occurs when the server executes the request, or a bug exists in the Web application
502 bad gateway
Gateway error or
503 service unavailable
This status code indicates that the server is temporarily overloaded or down for maintenance and cannot process requests at this time