The exams are over, the holiday has begun, time to start posting again — let’s write about HTTP status first.
What Is an HTTP Status Code
An HTTP status code (HTTP Status Code) is a 3-digit code used to indicate the HTTP response status of a web server; it shows how the server handled the HTTP request.
The Five Major Classes of HTTP Status Codes
100-199: Used to specify certain actions the client should take. 200-299: Used to indicate the request succeeded. 300-399: Used for files that have moved, often included in the Location header to specify the new address. 400-499: Used to point out client errors. 500-599: Used to support server errors.
HTTP Status Code List
HTTP Status Code List
| Status | English Name | Description |
|---|---|---|
| 100 | Continue | Continue. The client should continue with its request. |
| 101 | Switching Protocols | Switching protocols. The server switches protocols according to the client’s request. It can only switch to more advanced protocols, e.g., a newer version of HTTP. |
| 200 | OK | Success. Generally used for GET and POST requests. |
| 201 | Created | Created. The request succeeded and a new resource was created. |
| 202 | Accepted | Accepted. The request has been accepted but not yet processed. |
| 203 | Non-Authoritative Information | Non-authoritative information. The request succeeded, but the returned meta information is not from the original server but a copy. |
| 204 | No Content | No content. The server processed successfully but returned no content. This ensures the browser keeps displaying the current document without updating the page. |
| 205 | Reset Content | Reset content. The server processed successfully; the user agent (e.g., browser) should reset the document view. This return code can be used to clear the browser’s form fields. |
| 206 | Partial Content | Partial content. The server successfully processed part of the GET request. |
| 300 | Multiple Choices | Multiple choices. The requested resource may include multiple locations; a list of resource characteristics and addresses may be returned for the user agent (e.g., browser) to choose. |
| 301 | Moved Permanently | Moved permanently. The requested resource has been permanently moved to a new URI; the response includes the new URI, and the browser will automatically redirect to it. Any future new request should use the new URI instead. |
| 302 | Found | Temporary move. Similar to 301, but the resource is only moved temporarily. The client should keep using the original URI. |
| 303 | See Other | See other. Similar to 301. Use GET and POST requests to view. |
| 304 | Not Modified | Not modified. The requested resource was not modified. When the server returns this status code, it returns no resource. Clients usually cache visited resources, and by providing a header indicating the client only wants resources modified after a given date. |
| 305 | Use Proxy | Use proxy. The requested resource must be accessed through a proxy. |
| 306 | Unused | An obsolete HTTP status code. |
| 307 | Temporary Redirect | Temporary redirect. Similar to 302. Uses GET to redirect. |
| 400 | Bad Request | The client’s request had a syntax error the server could not understand. |
| 401 | Unauthorized | The request requires user authentication. |
| 402 | Payment Required | Reserved for future use. |
| 403 | Forbidden | The server understood the client’s request but refuses to execute it. |
| 404 | Not Found | The server could not find the resource (web page) based on the client’s request. With this code, web designers can set up a custom “requested resource not found” page. |
| 405 | Method Not Allowed | The method in the client’s request is not allowed. |
| 406 | Not Acceptable | The server could not fulfill the request based on the content characteristics requested by the client. |
| 407 | Proxy Authentication Required | The request requires proxy authentication. Similar to 401, but the requester should authorize using a proxy. |
| 408 | Request Time-out | The server waited too long for the request sent by the client and timed out. |
| 409 | Conflict | The server may return this code when completing the client’s PUT request; a conflict occurred while processing the request. |
| 410 | Gone | The resource requested by the client no longer exists. 410 differs from 404 — if a resource previously existed but is now permanently deleted, the 410 code can be used; web designers can specify the resource’s new location via the 301 code. |
| 411 | Length Required | The server cannot process the request information sent by the client without a Content-Length. |
| 412 | Precondition Failed | The precondition in the client’s request information is wrong. |
| 413 | Request Entity Too Large | The server cannot process the request because the entity is too large, so it refuses the request. To prevent repeated client requests, the server may close the connection. If the server is only temporarily unable to process it, it will include a Retry-After response. |
| 414 | Request-URI Too Large | The requested URI is too long (the URI is usually the web address), and the server cannot process it. |
| 415 | Unsupported Media Type | The server cannot process the media format attached to the request. |
| 416 | Requested range not satisfiable | The range requested by the client is invalid. |
| 417 | Expectation Failed | The server cannot satisfy the Expect request header. |
| 500 | Internal Server Error | Internal server error; the request could not be completed. |
| 501 | Not Implemented | The server does not support the requested functionality and cannot complete the request. |
| 502 | Bad Gateway | As a gateway or proxy, the server received an invalid request from the upstream server. |
| 503 | Service Unavailable | The server is temporarily unable to process the client’s request due to overload or maintenance. The duration may be included in the server’s Retry-After header. |
| 504 | Gateway Time-out | As a gateway or proxy, the server did not get the request from the upstream server in time. |
| 505 | HTTP Version not supported | The server does not support the HTTP protocol version requested and cannot complete processing. |
