HTTP Status Codes Cheat Sheet

Comprehensive HTTP status code reference with meanings, examples, and debugging guidance.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all

Status Code Classes

The five response classes and how to reason about them.

HTTP status code classes

Understand the five categories of HTTP responses.

textANYhttpstatus-codesclasses
text
1xx Informational
2xx Success
3xx Redirection
4xx Client Error
5xx Server Error
Notes

HTTP responses are grouped into five classes: informational, successful, redirection, client error, and server error responses. That grouping is reflected in current HTTP references.

Debug status codes in the right order

A quick flow for deciding where a problem lives.

textANYhttpdebuggingworkflow
text
1) Check request method, URL, headers, and body
2) Inspect auth and permissions
3) Follow redirects if needed
4) Check upstream/app logs for 5xx
5) Confirm caching/proxy/CDN behavior
Notes

This is a practical troubleshooting flow. 4xx responses usually point at client-side request issues or access rules, while 5xx responses usually indicate server-side failure.

Check headers and status with curl

Inspect the response line and headers only.

bashANYcurlhttpstatus-codeheaders
bash
curl -I https://example.com
Notes

Useful when you only need the status code, headers, redirect location, cache headers, or server details.

See the full request/response exchange

Use verbose mode to diagnose redirects, TLS, and headers.

bashANYcurlhttpdebuggingverbose
bash
curl -v https://example.com
Notes

Verbose mode is one of the fastest ways to understand why you received a given HTTP status.

Follow redirects

Useful for 301, 302, 307, and 308 responses.

bashANYcurlredirectshttp
bash
curl -L https://example.com
Notes

Without `-L`, curl shows the redirect response; with `-L`, it follows the `Location` header.

Common API Response Patterns

Typical status codes used by REST-ish APIs.

GET success codes

Typical success responses for reads.

textANYapihttpget
text
200 OK
206 Partial Content
304 Not Modified
Notes

`200` is the common success response for normal reads; `206` is used with range requests; `304` is used with conditional requests.

Create success codes

Typical responses when creating resources.

textANYapihttppostcreate
text
201 Created
202 Accepted
204 No Content
Notes

`201` commonly indicates a resource was created, while `202` means the request was accepted for asynchronous processing and may not be completed yet.

Authentication and authorization codes

The most common auth-related status codes.

textANYapiauthhttp
text
401 Unauthorized
403 Forbidden
407 Proxy Authentication Required
Notes

`401` typically means authentication is required or invalid, while `403` usually means the server understood the request but refuses it. `407` is the proxy-auth equivalent of `401`.

Rate limiting and overload codes

Responses commonly used when a client must back off.

textANYapirate-limithttp
text
408 Request Timeout
425 Too Early
429 Too Many Requests
503 Service Unavailable
Notes

`429` is the canonical rate-limit response; `503` is also often used for temporary overload or maintenance.

Recommended next

No recommendations yet.