StackCards StackCards

← All decks

HTTP status codes

The codes you meet every day while building or debugging anything on the web.

28 cardsBeginnerCode

Download the deck Get StackCards

Open the downloaded file on your iPhone or iPad and choose StackCards. It is also in the app: Library tab, then Add to my library.

What is inside

200OK. The request worked and the response carries what you asked for.
201Created. A new resource now exists, usually the answer to a POST.
202Accepted. The server took the request but has not finished the work yet.
204No Content. It worked and there is nothing to send back.
301Moved Permanently. The address changed for good; update your links.
302Found. A temporary redirect; keep using the original address.
304Not Modified. Your cached copy is still fine, so no body is sent.
307Temporary Redirect. Like 302, but the method and body must stay the same.
308Permanent Redirect. Like 301, but the method and body must stay the same.
400Bad Request. The server could not understand the request, often malformed syntax.
401Unauthorized. You need to authenticate first; the name is misleading, it means unauthenticated.
403Forbidden. The server knows who you are and still says no.
404Not Found. Nothing lives at that address.
405Method Not Allowed. The address exists, but not for this verb (say, POST on a read-only route).
408Request Timeout. The client took too long to finish sending the request.
409Conflict. The request clashes with the current state, like editing a stale version.
410Gone. It used to exist and was removed on purpose; don't come back.
413Content Too Large. The body you sent is bigger than the server accepts.
415Unsupported Media Type. The server does not accept the format of the body you sent.
418I'm a teapot. A joke code from an April Fools' RFC, refusing to brew coffee.
422Unprocessable Content. The syntax is valid but the values fail validation.
429Too Many Requests. You are being rate limited; slow down and check Retry-After.
500Internal Server Error. Something broke on the server and it can't say more.
501Not Implemented. The server doesn't support what the request needs.
502Bad Gateway. A proxy got an invalid answer from the server behind it.
503Service Unavailable. Overloaded or down for maintenance, usually temporary.
504Gateway Timeout. A proxy waited for the upstream server and gave up.
What do the five classes mean?1xx informational, 2xx success, 3xx redirection, 4xx the client got it wrong, 5xx the server got it wrong.