
* WeChat Official Account Push Rules Updated *
* Click the star to not miss any information *
When a client sends a request to a server, the server returns the processing result to the client. The HTTP status code is a three-digit code returned by the server to the client, used to describe the state of the response result. Through HTTP status codes, we can understand whether the request was successfully processed or if there was an issue. HTTP status codes are divided into five categories: 1xx (Informational Response), 2xx (Successful Response), 3xx (Redirection), 4xx (Client Error), and 5xx (Server Error). This article will analyze these status codes and their typical application scenarios one by one.
Introduction
When a client sends a request to a server, the server returns the processing result to the client. The HTTP status code is a three-digit code returned by the server to the client, used to describe the state of the response result. Through HTTP status codes, we can understand whether the request was successfully processed or if there was an issue. HTTP status codes are divided into five categories: 1xx (Informational Response), 2xx (Successful Response), 3xx (Redirection), 4xx (Client Error), and 5xx (Server Error). This article will analyze these status codes and their typical application scenarios.
1xx Informational Response: Request Received, Further Action Required
1xx status codes indicate that the server has received the request, but further processing is needed. Common status codes include:
-
100 Continue: The client can continue sending the request body (such as POST data). It is used to confirm that the server can accept the request before uploading large data.
-
101 Switching Protocols: The server agrees to switch protocols based on the client request. For example, switching from HTTP to WebSocket.
-
102 Processing: The request is being processed, and the client does not need to resend.
Application scenarios: 1xx status codes are mainly used to optimize the request process and reduce unnecessary data transmission.
2xx Successful Response: Request Successfully Processed
2xx status codes indicate that the request has been successfully received, understood, and processed. Common status codes include:
-
200 OK: The most common status code, indicating that the request was successful, usually returning the requested resource (such as HTML, JSON).
-
201 Created: The request was successful and a new resource was created. For example, this status is returned after a POST request creates a new user.
-
202 Accepted: The request has been accepted but has not yet been completed, commonly found in asynchronous operations.
-
204 No Content: The request was successful, but no content is returned. Suitable for update operations.
-
206 Partial Content: Used for resuming uploads, returning partial resource content.
Application scenarios: 2xx status codes are the core of normal system operation, covering the vast majority of successful network requests.
3xx Redirection: Resource Moved, Further Action Required
3xx status codes indicate that the client needs to take additional actions to complete the request. Common status codes include:
-
301 Moved Permanently: The resource has been permanently moved to a new location, and the client needs to update the URL.
-
302 Found: The resource has been temporarily moved to a new location, but may revert to the original address.
-
303 See Other: The client should use the GET method to obtain the resource, commonly used for redirection after form submission.
-
304 Not Modified: The resource has not changed, and the client can use the cached copy to save bandwidth.
-
307 Temporary Redirect: Similar to 302, but requires using the original request method.
-
308 Permanent Redirect: Similar to 301, but requires using the original request method.
Application scenarios: 3xx status codes are commonly used in website restructuring, SEO optimization, and cache management.
4xx Client Error: Request Error, Needs Correction and Retry
4xx status codes indicate that there is a problem with the request made by the client. Common status codes include:
-
400 Bad Request: The request is invalid, possibly due to a syntax error or missing parameters.
-
401 Unauthorized: Unauthorized, authentication credentials are required.
-
403 Forbidden: The server refuses the request, even if authentication is successful, access to the resource is denied.
-
404 Not Found: The resource does not exist or the URL is incorrect.
-
405 Method Not Allowed: The request method (such as GET, POST) is not allowed.
-
408 Request Timeout: The request timed out, and the server did not receive the complete request.
-
429 Too Many Requests: The client has sent too many requests in a short period and is being rate-limited.
Application scenarios: 4xx status codes guide the client to correct the request, improving user experience.
5xx Server Error: Error Processing Request on Server
5xx status codes indicate that the server failed to process the request correctly, usually due to internal server issues. Common status codes include:
-
500 Internal Server Error: A general error, indicating that the server cannot complete the request.
-
501 Not Implemented: The server does not support the method or functionality requested.
-
502 Bad Gateway: The gateway or proxy server received an invalid response.
-
503 Service Unavailable: The server is temporarily overloaded or undergoing maintenance and cannot process the request.
-
504 Gateway Timeout: The gateway or proxy did not receive a timely response from the upstream server.
-
505 HTTP Version Not Supported: The server does not support the HTTP version used in the request.
Application scenarios: 5xx status codes are used to diagnose and resolve server-side issues.
Conclusion
HTTP status codes are an important part of communication between the server and the client. Through them, we can better understand the result information of HTTP requests and responses, helping developers or testers quickly locate issues. Whether being asked in an interview about “common HTTP status codes?”, or in practical applications at work, understanding these HTTP status codes is necessary.
“
lemon ban
【Get It Free】
Every| Day| Profit|
As the saying goes
Other mountains can be used to attack jade
Looking more and learning from others is still helpful

Scan the QR code and reply “0113“
to get it for free~

Follow us for more free materials