HTTP Status Codes
When a user visits a webpage, their browser sends a request to the server where the webpage is hosted. Before the browser can display the webpage, the server returns a server header containing an HTTP status code to respond to the browser's request.
The English term for HTTP status code is HTTP Status Code.
Here are some common HTTP status codes:
- 200 - Request succeeded
- 301 - Resource (such as a webpage) has been permanently moved to another URL
- 404 - The requested resource (such as a webpage) does not exist
- 500 - Internal server error
HTTP Status Code Categories
HTTP status codes consist of three decimal digits, with the first digit defining the type of status code. Responses are categorized into five types: informational responses (100–199), successful responses (200–299), redirects (300–399), client errors (400–499), and server errors (500–599):
Category | Description |
---|---|
1** | Informational, the server has received the request and the requester should continue the operation |
2** | Success, the operation was successfully received and processed |
3** | Redirection, further action needs to be taken to complete the request |
4** | Client error, the request contains syntax errors or cannot be fulfilled |
5** | Server error, the server encountered an error while processing the request |
HTTP Status Code List:
Status Code | English Name | Description |
---|---|---|
100 | Continue | Continue. The client should proceed with its request |
101 | Switching Protocols | Switching protocols. The server is switching protocols as requested by the client. This can only be to a more advanced protocol, such as switching to a newer version of HTTP |
200 | OK | Request succeeded. Generally used for GET and POST requests |
201 | Created | Created. The request was successful 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 was successful, but the returned metadata is not from the original server but a copy |
204 | No Content | No content. The server successfully processed the request but is not returning any content. This can ensure the browser continues to display the current document without updating it |
205 | Reset Content | Reset content. The server processed the request successfully, and the user's terminal (e.g., browser) should reset the document view. This can be used to clear form fields in the browser |
206 | Partial Content | Partial content. The server successfully processed a partial GET request |
300 | Multiple Choices | Multiple choices. The requested resource has multiple options, and the response can return a list of resource characteristics and addresses for the user's terminal (e.g., browser) to choose from |
301 | Moved Permanently | Moved permanently. The requested resource has been permanently moved to a new URI, and the response includes the new URI. Browsers will automatically redirect to the new URI. Any future requests should use the new URI |
302 | Found | Temporary move. Similar to 301, but the resource is only temporarily moved. The client should continue to use the original URI |
303 | See Other | See other address. Similar to 301. Used for GET and POST requests to view another address |
304 | Not Modified | Not modified. The requested resource has not been modified. When the server returns this status code, it does not return any resource. Clients typically cache accessed resources and provide a header indicating they only want resources modified after a specified date |
305 | Use Proxy | Use proxy. The requested resource must be accessed through a proxy |
306 | Unused | This HTTP status code has been deprecated |
307 | Temporary Redirect | Temporary redirect. Similar to 302. Uses GET request for redirection |
400 | Bad Request | The client's request contains syntax errors that the server cannot understand |
401 | Unauthorized | Authentication is required for the request |
402 | Payment Required | Reserved for future use |
403 | Forbidden | The server understands the client's request but refuses to fulfill it |
404 | Not Found | The server cannot find the requested resource (webpage). This code allows web designers to set a custom page for "The resource you requested could not be found" |
405 | Method Not Allowed | The method specified in the client's request is not allowed |
406 | Not Acceptable | The server cannot 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 the proxy. |
408 | Request Time-out | The server timed out waiting for the client's request. |
409 | Conflict | The server may return this code when completing a client's PUT request; a conflict occurred while the server was processing the request. |
410 | Gone | The resource requested by the client no longer exists. 410 differs from 404; if the resource was previously available and has been permanently deleted, 410 should be used. Website designers can specify a new location for the resource using a 301 code. |
411 | Length Required | The server cannot process the request sent by the client without a Content-Length. |
412 | Precondition Failed | The precondition given in the client's request is incorrect. |
413 | Request Entity Too Large | The request entity is too large for the server to process, leading to the server rejecting the request. To prevent continuous client requests, the server may close the connection. If the server is temporarily unable to process the request, it may include a Retry-After response. |
414 | Request-URI Too Large | The requested URI (usually the URL) is too long for the server to process. |
415 | Unsupported Media Type | The server cannot process the media format attached to the request. |
416 | Requested range not satisfiable | The range specified in the client's request is invalid. |
417 | Expectation Failed | The server cannot meet the requirements of the Expect request header. |
500 | Internal Server Error | An internal server error occurred, preventing the server from fulfilling the request. |
501 | Not Implemented | The server does not support the functionality required to fulfill the request. |
502 | Bad Gateway | The server, acting as a gateway or proxy, received an invalid response from the remote server while trying to execute the request. |
503 | Service Unavailable | The server is temporarily unable to handle the client's request due to overload or maintenance. The delay duration may be included in the server's Retry-After header. |
504 | Gateway Time-out | The server acting as a gateway or proxy did not receive a timely response from the remote server. |
505 | HTTP Version not supported | The server does not support the HTTP protocol version used in the request, preventing it from completing the request. |