If you’re a website owner or a developer, you must have come across HTTP status codes. These codes indicate the status of a website’s server when you access it. They help understand whether a website’s server is functioning correctly or not. In this article, we’ll cover everything you need to know about HTTP status codes.
Contents
Also Read: HTTP Methods
What is an HTTP Status Code?
An HTTP status code is a three-digit number that comes as a response to an HTTP request. It indicates the status of the requested resource. In simpler terms, when you request a web page, the server sends back a code that lets you know if the server is okay and if the page you’ve requested exists.
Types of HTTP Status Codes
There are five classes of HTTP status codes:
- 1xx: Informational – Request received, continuing process
- 2xx: Success – The action was successfully received, understood, and accepted
- 3xx: Redirection – Further action must be taken in order to complete the request
- 4xx: Client Error – The request contains bad syntax or cannot be fulfilled
- 5xx: Server Error – The server failed to fulfill an apparently valid request
Informational responses (100–199)
These are used to acknowledge and inform that the server has received the request. An example of this status code is 100, which means the request was received, and the server is continuing the process.
Status Code | Description |
---|---|
100 | Continue |
101 | Switching Protocols |
102 | Processing |
103 | Early Hints |
104 – 199 | Unassigned |
- 100 Continue: The server has received the initial part of the request and is continuing to process the request.
- 101 Switching Protocols: The server has received a request to switch protocols and is acknowledging this with the client.
- 102 Processing: The server has received and is processing the request, but no response is available yet.
- 103 Early Hints: The server is sending some response headers before the final response, to give the client some information that can be used to optimize the request.
Successful responses (200–299)
These indicate that the server has successfully received, understood, and processed the request. An example of this status code is 200, which means the request was successful and resulted in a response.
Status Code | Description |
---|---|
200 | OK |
201 | Created |
202 | Accepted |
203 | Non-Authoritative Information |
204 | No Content |
205 | Reset Content |
206 | Partial Content |
207 | Multi-Status |
208 | Already Reported |
209 – 225 | Unassigned |
226 | IM Used |
- 200 OK: The request has been successful, and the response body contains the requested information.
- 201 Created: The request has been successful, and a new resource has been created as a result.
- 202 Accepted: The request has been accepted for processing, but the processing has not been completed yet.
- 203 Non-Authoritative Information: The server is a proxy, and the response is coming from a different source, but is still considered valid.
- 204 No Content: The request has been successful, but there is no response body to return.
- 205 Reset Content: The request has been successful, and the client should reset its view of the resource.
- 206 Partial Content: The server is sending only part of the resource requested by the client.
- 207 Multi-Status: The response is a collection of separate responses, one for each resource in the request.
- 208 Already Reported: The members of a WebDAV binding have already been enumerated in a previous reply to this request, and are not being included again.
- 226 IM Used: The response is a representation of the result of one or more instance manipulations applied to the current instance.
Redirection messages (300–399)
These indicate that further action is required to complete the request. They are used for redirecting users to different URLs or locations. An example of this status code is 302, which means the resource has temporarily moved to a different URL.
Status Code | Description |
---|---|
300 | Multiple Choices |
301 | Moved Permanently |
302 | Found |
303 | See Other |
304 | Not Modified |
305 | Use Proxy |
306 | Switch Proxy (Deprecated) |
307 | Temporary Redirect |
308 | Permanent Redirect |
309 – 399 | Unassigned |
- 300 Multiple Choices: The request has multiple possible responses, and the server is returning a list of options for the client to choose from.
- 301 Moved Permanently: The requested resource has been permanently moved to a new URL, and the client should update its bookmarks and links accordingly.
- 302 Found: The requested resource has been temporarily moved to a new URL, and the client should continue to use the original URL for future requests.
- 303 See Other: The response to the request can be found under a different URL, and the client should make a new request using the new URL.
- 304 Not Modified: The requested resource has not been modified since the client’s last request, and the server is returning the cached copy.
- 305 Use Proxy: The requested resource can only be accessed through a proxy, and the client should use the proxy to access the resource.
- 306 Switch Proxy (Deprecated): This status code is no longer used.
- 307 Temporary Redirect: The requested resource has been temporarily moved to a new URL, and the client should continue to use the original URL for future requests.
- 308 Permanent Redirect: The requested resource has been permanently moved to a new URL, and the client should update its bookmarks and links accordingly.
Client error responses (400–499)
These indicate that the server received a malformed or invalid request from the client. An example of this status code is 404, which means the requested resource was not found on the server.
Status Code | Description |
---|---|
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
403 | Forbidden |
404 | Not Found |
405 | Method Not Allowed |
406 | Not Acceptable |
407 | Proxy Authentication Required |
408 | Request Timeout |
409 | Conflict |
410 | Gone |
411 | Length Required |
412 | Precondition Failed |
413 | Payload Too Large |
414 | URI Too Long |
415 | Unsupported Media Type |
416 | Range Not Satisfiable |
417 | Expectation Failed |
418 | I’m a teapot |
421 | Misdirected Request |
422 | Unprocessable Entity |
423 | Locked |
424 | Failed Dependency |
426 | Upgrade Required |
428 | Precondition Required |
429 | Too Many Requests |
430 | Unassigned |
431 | Request Header Fields Too Large |
432 – 450 | Unassigned |
451 | Unavailable For Legal Reasons |
452 – 499 | Unassigned |
- 400 Bad Request: The server was unable to understand the request due to invalid syntax.
- 401 Unauthorized: The request requires authentication, and the client has not provided valid credentials.
- 402 Payment Required: This status code is reserved for future use.
- 403 Forbidden: The client does not have permission to access the requested resource.
- 404 Not Found: The requested resource could not be found on the server.
- 405 Method Not Allowed: The requested method is not supported for the requested resource.
- 406 Not Acceptable: The requested resource is not capable of generating a response that meets the requirements specified in the request’s headers.
- 407 Proxy Authentication Required: The client must first authenticate itself with the proxy before making this request.
- 408 Request Timeout: The server timed out waiting for the request from the client.
- 409 Conflict: The request could not be completed due to a conflict with the current state of the resource.
- 410 Gone: The requested resource is no longer available on the server and there is no forwarding address.
- 411 Length Required: The server requires a Content-Length header to be included in the request.
- 412 Precondition Failed: The precondition given in the request header fields did not match the server’s preconditions.
- 413 Payload Too Large: The request is larger than the server is willing or able to process.
- 414 URI Too Long: The URI provided in the request is too long for the server to process.
- 415 Unsupported Media Type: The server does not support the media type specified in the request’s headers.
- 416 Range Not Satisfiable: The requested range cannot be returned by the server.
- 417 Expectation Failed: The expectation given in the request’s Expect header could not be met by the server.
- 418 I’m a teapot: This status code is a joke and not intended to be used in serious applications.
- 421 Misdirected Request: The request was directed at a server that is not able to produce a response.
- 422 Unprocessable Entity: The server understands the request, but is unable to process it due to semantic errors.
- 423 Locked: The requested resource is locked and the client should try again later.
- 424 Failed Dependency: The requested resource depends on another resource, and that resource failed to complete the request.
- 426 Upgrade Required: The client should switch to a different protocol, such as TLS/1.3.
- 428 Precondition Required: The server requires the request to be conditional, and the client did not provide the necessary precondition headers.
- 429 Too Many Requests: The user has sent too many requests in a given amount of time (“rate limiting”).
- 431 Request Header Fields Too Large: The server is unwilling to process the request because its header fields are too large.
- 451 Unavailable For Legal Reasons: The requested resource is unavailable due to legal reasons, such as censorship or government-mandated blocked access.
Server error responses (500–599)
These indicate that there was an error on the server while processing the request. An example of this status code is 500, which means there was an internal server error, and the request could not be completed.
Status Code | Description |
---|---|
500 | Internal Server Error |
501 | Not Implemented |
502 | Bad Gateway |
503 | Service Unavailable |
504 | Gateway Timeout |
505 | HTTP Version Not Supported |
506 | Variant Also Negotiates |
507 | Insufficient Storage |
508 | Loop Detected |
509 | Unassigned |
510 | Not Extended |
511 | Network Authentication Required |
512 – 599 | Unassigned |
- 500 Internal Server Error: The server encountered an unexpected condition that prevented it from fulfilling the request.
- 501 Not Implemented: The server does not support the functionality required to fulfil the request.
- 502 Bad Gateway: The server, while acting as a gateway or proxy, received an invalid response from an upstream server.
- 503 Service Unavailable: The server is currently unable to handle the request due to temporary overload or maintenance of the server.
- 504 Gateway Timeout: The server, while acting as a gateway or proxy, did not receive a timely response from an upstream server.
- 505 HTTP Version Not Supported: The server does not support the HTTP protocol version used in the request.
- 506 Variant Also Negotiates: Transparent content negotiation for the request results in a circular reference.
- 507 Insufficient Storage: The server is unable to store the representation needed to complete the request.
- 508 Loop Detected: The server detected an infinite loop while processing the request.
- 510 Not Extended: Further extensions to the request are required for the server to fulfill it.
- 511 Network Authentication Required: The client needs to authenticate to gain network access.
HTTP Status Codes Cheat Sheet
Download HTTP Status Codes Cheat Sheet
Importance of HTTP Status Codes
HTTP status codes have a significant impact on a website’s user experience. If a user comes across an error code, it can be frustrating and can also cause them to leave the website. It can also impact a website’s search engine optimization (SEO) and can result in a lower search engine ranking.
For website owners, understanding different HTTP status codes can help them identify and resolve issues on their website. For example, if a website owner sees a 404 status code, they can quickly identify which pages are missing and fix them.
Conclusion
In conclusion, HTTP status codes play a critical role in the functioning and user experience of a website. Proper understanding of different status codes can help website owners and developers identify and fix issues on their website. Therefore, it’s essential to pay attention to these codes and address any issues that may arise to ensure a seamless user experience.
Checkout the HTTPS category for more related content HTTP/HTTPS.
Follow us on Facebook, YouTube, Instagram, and Twitter for more exciting content and the latest updates.