HTTP status codes are three-digit numbers that are returned by a server in response to a client’s request. These codes provide information about the status of the requested resource, such as whether it was successfully retrieved or if there was an error. Understanding HTTP status codes is essential for web developers and website owners, as they can help diagnose and troubleshoot issues with a website.
There are five classes of HTTP status codes, each with its own range of codes. The first digit of the status code indicates the class of the response, while the remaining two digits provide more specific information about the status.
The most common HTTP status codes are the 200 series, which indicate that the request was successful. For example, a 200 OK status code means that the server successfully processed the request and returned the requested resource.
The 300 series codes indicate that the requested resource has moved or been redirected. For example, a 301 Moved Permanently status code means that the requested resource has been permanently moved to a new URL.
The 400 series codes indicate that there was an error with the client’s request. For example, a 404 Not Found status code means that the requested resource could not be found on the server.
The 500 series codes indicate that there was an error with the server. For example, a 500 Internal Server Error status code means that there was an error with the server that prevented it from fulfilling the request.
In conclusion, HTTP status codes are an essential part of the web development process. They provide valuable information about the status of a requested resource and can help diagnose and troubleshoot issues with a website. By understanding HTTP status codes, web developers and website owners can ensure that their websites are functioning properly and providing a positive user experience.
Cheat Sheet
Status Code | Description |
100 | Continue |
101 | Switching Protocols |
102 | Processing |
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 |
226 | IM Used |
300 | Multiple Choices |
301 | Moved Permanently |
302 | Found |
303 | See Other |
304 | Not Modified |
305 | Use Proxy |
306 | Switch Proxy |
307 | Temporary Redirect |
308 | Permanent Redirect |
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 |
431 | Request Header Fields Too Large |
451 | Unavailable For Legal Reasons |
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 |
510 | Not Extended |
511 | Network Authentication Required |
Informational Status Codes | |
Status Code | Description |
100 | Continue |
101 | Switching Protocols |
102 | Processing |
Successful Status Codes | |
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 |
226 | IM Used |
Redirection Status Codes | |
Status Code | Description |
300 | Multiple Choices |
301 | Moved Permanently |
302 | Found |
303 | See Other |
304 | Not Modified |
305 | Use Proxy |
306 | Switch Proxy |
307 | Temporary Redirect |
308 | Permanent Redirect |
Client Error Status Codes | |
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 |
431 | Request Header Fields Too Large |
451 | Unavailable For Legal Reasons |
Server Error Status Codes | |
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 |
510 | Not Extended |
511 | Network Authentication Required |