Common HTTP Status Codes

Original link: https://mp.weixin.qq.com/s/AjHc5AQeH9LFQ-zYhrEV7g

1. What is an HTTP Status Code?

A status code is a parameter that describes the result of a request sent by the client to the server. With HTTP status codes, users can know whether the request was processed normally or if an error occurred.

Status codes consist of a 3-digit number and a reason phrase, such as 200 OK or 500 Internal Server Error.

2. Categories of Status Codes

There are many status codes, but they can be categorized as follows:

Status Code Category Reason Phrase
1XX Informational (Information Status Code) The request is being processed
2XX Success (Success Status Code) The request was successful and completed
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 (Server Error Status Code) The server encountered an error while processing the request

3. 2XX Success

A 2XX response indicates that the request has been successfully processed.

3.1 200 OK

200 OK is one of the most commonly encountered requests, indicating that the request was successful and was processed correctly.

Common HTTP Status Codes

3.2 204 No Content

HTTP status 204 (No Content) indicates that the server successfully processed the request but did not return any content.

Common HTTP Status Codes

3.3 206 Partial Content

This status code indicates that the client made a range request, and the server successfully fulfilled that partial GET request. The response message contains the entity range specified by Content-Range.

Common HTTP Status Codes

A range request refers to accessing a resource that is large. If downloaded all at once, an interruption or exception during the download would require starting over. A range request allows for requesting only a portion of the entity being downloaded. For example, for a 10,000-byte image, only the data from 0-5000 bytes is requested first, followed by a request for 5001-10000 bytes. For instance, when loading an image, half of it loads first.

4. 3XX Redirection

A 3XX response indicates that the browser needs to perform some special processing to handle the request correctly.

4.1 301 Moved Permanently

Permanently moved; this status code indicates that the resource has been assigned a new URI.

Common HTTP Status Codes

4.2 302 Found

Temporary redirection; this status code indicates that the requested resource has been assigned a new URL and the user should log in using the new URL this time.

5. 4XX

A 4XX result indicates that the client is the primary cause of the problem.

5.1 400 Bad Request

This status code indicates that there is a syntax error in the request message.

Common HTTP Status Codes

5.2 401 Unauthorized

This status code indicates that the request requires HTTP authentication.

5.3 403 Forbidden

This status code explicitly indicates that access to the requested resource is denied.

Common HTTP Status Codes

5.4 404 Not Found

The requested resource does not exist. This often occurs when there is a typo in the URL.

Common HTTP Status Codes

6. 5XX

A 5XX indicates a server error.

6.1 500 Internal Server Error

This status code indicates that an error occurred while the server was processing the request.

6.2 503 Service Unavailable

This status code indicates that the server is temporarily overloaded or undergoing maintenance and cannot process the request at this time.

Common HTTP Status Codes

Original link: https://mp.weixin.qq.com/s/AjHc5AQeH9LFQ-zYhrEV7g
Disclaimer: The articles reposted by this public account have been sourced and credited as much as possible. Copyright belongs to the original author. If there are omissions or infringements, please contact us for modification/deletion.

Common HTTP Status Codes

Previous Exciting Content

Why Use Overseas Cloud Servers? Do You Know?

From the practicality of business, how to choose server hosting!

Website Construction | Essential Points for Configuring Hong Kong High Defense Virtual Hosts

Bare Metal Supports Various Business Needs, This Configuration is More Cost-Effective!

Common HTTP Status Codes

Leave a Comment