The HTTP status code

During development, the front-end needs to request data through a back-end interface. A status code identifying the state of the resource is present in the response. Although the status code can be modified at will, we need to understand the common meaning of the status code for normalization.

2 xx success

  • 200 If yes, the request is correctly processed by the server
  • 204 No Content: Indicates that the request is successful but the response does not contain the body part
  • 205 Reset Content, same as 204, but requires the requester to Reset the Content
  • 206 Partial Content for a range request

3 xx redirection

  • 301 Moved PERMANENTLY, permanently redirected permanently, indicating the new URL to which resources are allocated
  • 302 Found, temporary redirection, indicating that the resource was temporarily assigned a new URL
  • 303 See Other: indicates that another URL exists for the resource. Use the GET method to obtain the resource
  • 304 Not Modified: indicates that the server allows access to the resource but the request condition is not met
  • 307 Temporary redirect similar to 302, but expects the client to keep the request method the same and send the request to the new address

4XX Client error

  • 400 Bad Request: Syntax errors exist in the request packet
  • 401 Unauthorized: Indicates that the request requires HTTP authentication information
  • 403 Forbidden: The access to the requested resource is denied
  • 404 not found: No requested resource was found on the server

5XX Server error

  • 500 Internal server error: An error occurred when the server executed the request
  • 501 Not Implemented: The server does Not support a function that is required for the current request
  • 503 Service Unavailable: The server is temporarily overloaded or is being shut down for maintenance and cannot process requests