1. The status code informs the result of the request returned from the server

Category of the status code

code category The reason the phrase
1XX Information (Informational status code) The received request is being processed
2XX Success (Success Status code) The request is successfully processed
3XX Redirection (Redirection status code) Additional action is required to complete the request
4XX Client Error (Client Error status code) The server cannot process the request
5XX Server Error The server failed to process the request

2. 2XX is successful

  • 200: OK
  • 204: No Content Indicates that the request received by the server was successfully processed and does not return the body of any entity
  • 206: Partial Content Indicates that the client made a Partial request and the server returned the request successfully. The response message contains the entity Content in the Range specified by content-range

3. 3XX redirect

When the 301, 302, and 303 response status codes return, almost all browsers change POST to GET and remove the body of the request message, and the request is automatically sent again. The 301 and 302 standards prohibit the change of POST method to GET method, but in practice, people do not comply with them.

  • 301 Moved Permanently Redirected Permanently. Indicates that the requested resource has been assigned a new URI, and the URI indicated by the resource status should be used later
  • 302 Found Temporary redirect. Indicates that the requested resource has been assigned a new URI and the user is expected to access it using the new URI
  • 303 See Other: Because the resource corresponding to the request has another URI, the GET method should be used to obtain the requested resource
  • 304 Not Modified Indicates that the client sends an if-match, if-modified-since, if-none-match, if-range request message using the GET method. If- unmodified-since any header), the server allows the request to access the resource, but returns 304 Not Modified If the request does Not meet the condition.
  • 307 Temporary Redirect Temporary redirection. 307 Complies with browser standards and does not change from POST to GET

4. The 4XX client is incorrect

  • 400 Bad Request Syntax errors exist in the Request packet
  • 401 Unauthorized Indicates that the request to be sent requires HTTP authentication (BASIC authentication and DIGEST authentication). When the browser receives the 401 response for the first time, an authentication dialog will pop up
  • 403 Forbidden Forbidden The access to the requested resource is denied by the server
  • 404 Not Found

5. The 5XX server is faulty

  • 500 Internal Server Error Indicates that a Server Error occurred while executing the request
  • 503 Service Unavailable Indicates that the server is temporarily overloaded or is down for maintenance and cannot process requests