# HTTP Status Codes

57 HTTP status codes explained: what each means, common causes, how to fix it, and how to send it.

## 1xx Informational

Interim responses: the request is in progress, the final status is still to come.

- [100 Continue](https://www.devkult.com/http/100.md): The server received the request headers and the client should go ahead and send the body.
- [101 Switching Protocols](https://www.devkult.com/http/101.md): The server agrees to switch the connection to another protocol, most often WebSocket.
- [103 Early Hints](https://www.devkult.com/http/103.md): An interim response that lets the browser start preloading resources while the server is still preparing the page.

## 2xx Success

The request was received, understood and accepted.

- [200 OK](https://www.devkult.com/http/200.md): The request succeeded, and the response body holds the result.
- [201 Created](https://www.devkult.com/http/201.md): The request created a new resource, usually identified by the Location header.
- [202 Accepted](https://www.devkult.com/http/202.md): The request was accepted for processing, but the work isn't finished yet.
- [204 No Content](https://www.devkult.com/http/204.md): The request succeeded and there is intentionally no response body.
- [206 Partial Content](https://www.devkult.com/http/206.md): The server is returning only the byte range the client asked for.

## 3xx Redirection

The client must take further action — usually follow the Location header.

- [300 Multiple Choices](https://www.devkult.com/http/300.md): The resource has several representations and the client should pick one.
- [301 Moved Permanently](https://www.devkult.com/http/301.md): The resource has a new permanent URL; clients and search engines should use the Location instead.
- [302 Found](https://www.devkult.com/http/302.md): The resource is temporarily at another URL; keep using the original one for future requests.
- [303 See Other](https://www.devkult.com/http/303.md): Fetch the result from another URL with GET — the standard answer after a form POST.
- [304 Not Modified](https://www.devkult.com/http/304.md): The cached copy is still valid; use it instead of downloading the resource again.
- [307 Temporary Redirect](https://www.devkult.com/http/307.md): A temporary redirect where the client must repeat the exact same request — method and body — at the new URL.
- [308 Permanent Redirect](https://www.devkult.com/http/308.md): The resource moved permanently, and clients must repeat the same method and body at the new URL.

## 4xx Client Error

The request is wrong in some way; sending it again unchanged won't help.

- [400 Bad Request](https://www.devkult.com/http/400.md): The server can't process the request because something about it is malformed or invalid.
- [401 Unauthorized](https://www.devkult.com/http/401.md): The request lacks valid authentication credentials — the server doesn't know who you are.
- [402 Payment Required](https://www.devkult.com/http/402.md): Reserved for future use; some APIs use it to signal a billing problem.
- [403 Forbidden](https://www.devkult.com/http/403.md): The server understood the request but refuses to allow it.
- [404 Not Found](https://www.devkult.com/http/404.md): The server can't find anything at the requested URL.
- [405 Method Not Allowed](https://www.devkult.com/http/405.md): The URL exists, but it doesn't support the HTTP method used.
- [406 Not Acceptable](https://www.devkult.com/http/406.md): The server can't produce a response matching the request's Accept headers.
- [407 Proxy Authentication Required](https://www.devkult.com/http/407.md): Like 401, but a proxy between you and the server wants credentials.
- [408 Request Timeout](https://www.devkult.com/http/408.md): The server gave up waiting for the client to finish sending the request.
- [409 Conflict](https://www.devkult.com/http/409.md): The request conflicts with the current state of the resource.
- [410 Gone](https://www.devkult.com/http/410.md): The resource was deliberately removed and won't be coming back.
- [411 Length Required](https://www.devkult.com/http/411.md): The server refuses the request because it has no Content-Length header.
- [412 Precondition Failed](https://www.devkult.com/http/412.md): A condition in the request headers, such as If-Match, didn't hold, so nothing was changed.
- [413 Content Too Large](https://www.devkult.com/http/413.md): The request body is bigger than the server is willing to accept.
- [414 URI Too Long](https://www.devkult.com/http/414.md): The URL is longer than the server is willing to process.
- [415 Unsupported Media Type](https://www.devkult.com/http/415.md): The server won't accept the format of the request body (its Content-Type).
- [416 Range Not Satisfiable](https://www.devkult.com/http/416.md): The requested byte range lies outside the resource.
- [417 Expectation Failed](https://www.devkult.com/http/417.md): The server can't meet the requirement in the request's Expect header.
- [418 I'm a teapot](https://www.devkult.com/http/418.md): An April Fools' joke from 1998: the server refuses to brew coffee because it is a teapot.
- [421 Misdirected Request](https://www.devkult.com/http/421.md): The request went to a server that can't produce a response for that hostname.
- [422 Unprocessable Content](https://www.devkult.com/http/422.md): The request is well-formed, but its content fails validation.
- [423 Locked](https://www.devkult.com/http/423.md): The resource is locked and can't be modified right now (WebDAV).
- [425 Too Early](https://www.devkult.com/http/425.md): The server won't process a request that might be replayed, because it arrived as TLS early data.
- [426 Upgrade Required](https://www.devkult.com/http/426.md): The server refuses the request over the current protocol and asks the client to upgrade.
- [428 Precondition Required](https://www.devkult.com/http/428.md): The server requires the request to be conditional, such as with If-Match, to prevent lost updates.
- [429 Too Many Requests](https://www.devkult.com/http/429.md): The client sent too many requests in a given amount of time — it's being rate limited.
- [431 Request Header Fields Too Large](https://www.devkult.com/http/431.md): The request's headers — often its cookies — are too large for the server.
- [451 Unavailable For Legal Reasons](https://www.devkult.com/http/451.md): Access is denied because of a legal demand, such as a court order or a government block.

## 5xx Server Error

The server failed to fulfil a valid request.

- [500 Internal Server Error](https://www.devkult.com/http/500.md): The server hit an unexpected condition and couldn't complete the request.
- [501 Not Implemented](https://www.devkult.com/http/501.md): The server doesn't support the functionality required — usually an HTTP method it doesn't recognise.
- [502 Bad Gateway](https://www.devkult.com/http/502.md): A proxy or gateway got an invalid response — or none at all — from the upstream server.
- [503 Service Unavailable](https://www.devkult.com/http/503.md): The server is temporarily unable to handle requests — overloaded or down for maintenance.
- [504 Gateway Timeout](https://www.devkult.com/http/504.md): A proxy or gateway didn't get a response from the upstream server in time.
- [505 HTTP Version Not Supported](https://www.devkult.com/http/505.md): The server doesn't support the HTTP version used in the request.
- [507 Insufficient Storage](https://www.devkult.com/http/507.md): The server can't store what's needed to complete the request.
- [508 Loop Detected](https://www.devkult.com/http/508.md): The server found an infinite loop while processing the request (WebDAV).
- [511 Network Authentication Required](https://www.devkult.com/http/511.md): You need to sign in to the network — a captive portal — before you can reach the internet.

## Unofficial: nginx & Cloudflare

Not defined by any RFC, but common in logs and on error pages.

- [499 Client Closed Request](https://www.devkult.com/http/499.md): An nginx log code: the client closed the connection before the server sent a response.
- [520 Web Server Returned an Unknown Error](https://www.devkult.com/http/520.md): Cloudflare got an empty, unknown or unexpected response from the origin server.
- [521 Web Server Is Down](https://www.devkult.com/http/521.md): Cloudflare couldn't connect to the origin server because the connection was refused.
- [522 Connection Timed Out](https://www.devkult.com/http/522.md): Cloudflare's TCP connection to the origin server timed out.
- [524 A Timeout Occurred](https://www.devkult.com/http/524.md): Cloudflare connected to the origin, but it didn't send an HTTP response within 100 seconds.