Make a summary every day, persistence is victory!

/** @date 2021-06-27 @description 图 文 HTTP - Chapter 4 - HTTP status code */Copy the code

one

  1. The HTTP status code’s job is to describe the result of the request returned when the client sends the request, so that the client can know whether the request was processed successfully or if an error occurred

2. The status code consists of three digits and a cause phrase. The first digit is 1-5, representing different result categories, and the last two digits are unclassified

3. 2XX- Success status code, indicating that the request is successfully processed

A. 200 OK: indicates that the request is successfully processed. B. 204 No Content: indicates that the request is successfully processed. However, the response packet does not contain the entity body and cannot be returned. Indicates that the client sends a range request and the server successfully processes the requestCopy the code
  1. 3XX- Redirect status code: The browser needs to perform some special processing to properly process the request
A. 301 Moved Permanently, indicating that the requested resource has been reassigned to the SPECIFIED URI and the new URI should be used in the future. A temporary redirection (similar to 301, but not permanent, but temporary) indicates that the requested resource has been assigned a new URI, and the request is expected to use the new URI C. 303 See Other: D. 304 Not Modified: if the resource requested has another URI, the client should use the GET method to obtain the resource. When the client sends a conditional request, the server allows the request to access the corresponding resource but the conditional request is not met, which has nothing to do with redirectionCopy the code
  1. 4XX- Client error: Indicates that the error occurred in the request is client-related
A. 400 Bad Request: A syntax error exists in the Request packet and you need to modify the syntax and send the Request again B. 401 Unauthorized: The Request to be sent requires authentication information that exceeds HTTP authentication c. 403 Forbidden: 404 Not Found: The requested resource cannot be Found on the serverCopy the code
  1. 5XX- Server error: Indicates that the request has an error related to the server
A. 500 Internal Server Error: An Error occurs when the Server executes a request, which may be caused by a Web application bug b. 502 Bad Gateway: 503 Service Unavailable: Indicates that the server is overloaded or down for maintenance and cannot process requests. D. 504 Gateway Timeout: Indicates that the server acting as the NMS or agent cannot obtain the response within the specified timeCopy the code