The status code is used to indicate whether the server handled the request correctly. Common types of status codes:

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

2xx

  1. 200 OK indicates that the request from the client is processed on the server

  2. 204 No Content Indicates that the server receives and successfully processes the request, but the response packet does not contain the body of the entity

  3. 206 Partial Content Indicates that the client made a Partial request and the server successfully executed the Partial request. The response message contains the entity content in the range specified by Content_Range.

3xx

  1. 301 Moved Permanently redirects Permanently, indicating that the requested resource has been assigned a new URI. The URI indicated by the resource should be used in the future

  2. 302 Found Temporary redirection, indicating that the requested resource has been assigned a new URI and the user is expected to access it using the new URI

  3. See Other: Because the resource corresponding to the request has another URI, the GET method should be used to obtain the requested resource

  4. 304 Not Modified Indicates that when the client sends a request with conditions attached, the server allows the request to access the resource. However, if the condition is Not met, the server returns 304 (the resource on the server is Not changed, and the client’s cache that has Not expired can be used directly).

  5. 307 Tempoerary Redirect Temporary redirects that comply with browser standards and do not change from POST to GET

4xx

  1. 400 Bad Request Indicates that the Request packet contains incorrect syntax

  2. 401 Unauthoried Indicates that the sent request requires authentication information authenticated through HTTP. If the request has been made once before, the user authentication fails

  3. 403 Forbidden Indicates that the requested resource is rejected by the server

  4. 404 Not Found The requested resource is Not Found on the server

5xx

  1. 500 Internal Server Error Indicates that an Error occurred during the Server request

  2. 503 Service Unavailable Indicates that the server is temporarily overloaded or is stopping for maintenance