Informational 1xx
1xx Codes
100Continue — server received headers, client should send body
101Switching Protocols — upgrading to WebSocket or HTTP/2
102Processing — server received request, still working (WebDAV)
103Early Hints — preload resources before final response
Usage Note
# 100 Continue: client sends Expect header, waits for 100 curl -H "Expect: 100-continue" -d @large.json URL # 101: upgrade to WebSocket Connection: Upgrade / Upgrade: websocket
Success 2xx
2xx Codes
200OK — standard success response
201Created — resource successfully created (POST/PUT)
202Accepted — request received, processing async
203Non-Authoritative Info — transformed by proxy
204No Content — success with no response body (DELETE)
205Reset Content — success, client should reset form
206Partial Content — range request fulfilled
207Multi-Status — multiple status codes (WebDAV)
REST API Usage
GET → 200Return resource with body
POST → 201Resource created, include Location header
PUT → 200/204Updated resource (with/without body)
DELETE → 204Deleted, no body returned
PATCH → 200Partial update, return modified resource
Redirection 3xx
3xx Codes
300Multiple Choices — multiple representations available
301Moved Permanently — resource moved, update bookmarks
302Found — temporary redirect (often misused as 303)
303See Other — redirect with GET after POST
304Not Modified — use cached version (ETag/If-Modified)
307Temporary Redirect — same method, temporary location
308Permanent Redirect — same method, permanent location
Redirect Behavior
301/308Permanent — search engines update index
302/307Temporary — original URL stays canonical
301/302May change method to GET on redirect
307/308Must preserve original HTTP method
Client Error 4xx
Common Client Errors
400Bad Request — malformed syntax or invalid parameters
401Unauthorized — authentication required or failed
403Forbidden — authenticated but not permitted
404Not Found — resource does not exist
405Method Not Allowed — HTTP method not supported
406Not Acceptable — can't satisfy Accept header
408Request Timeout — client too slow to send request
409Conflict — request conflicts with current state
More Client Errors
410Gone — resource permanently deleted (not just missing)
411Length Required — Content-Length header missing
412Precondition Failed — If-Match/If-Unmodified failed
413Content Too Large — request body exceeds limit
414URI Too Long — URL exceeds server limit
415Unsupported Media Type — Content-Type not accepted
422Unprocessable Content — valid syntax, semantic errors
429Too Many Requests — rate limit exceeded
Server Error 5xx
5xx Codes
500Internal Server Error — unhandled exception on server
501Not Implemented — server doesn't support the method
502Bad Gateway — upstream server sent invalid response
503Service Unavailable — overloaded or in maintenance
504Gateway Timeout — upstream server didn't respond in time
505HTTP Version Not Supported — version not handled
507Insufficient Storage — server can't store request (WebDAV)
511Network Auth Required — captive portal login needed
Retry Strategy
500Retry with backoff; may be transient
502/504Retry — upstream issue may resolve
503Check Retry-After header before retrying
501/505Do not retry — fix client request
Common Codes
Most-Used Codes (at a glance)
200OK — everything worked
201Created — new resource made
204No Content — success, empty body
301Moved Permanently — update URL
304Not Modified — use cache
400Bad Request — fix your request
401Unauthorized — log in first
403Forbidden — insufficient permissions
404Not Found — wrong URL or deleted
422Unprocessable — validation errors
429Too Many Requests — slow down
500Server Error — not your fault
502Bad Gateway — proxy/upstream failure
503Unavailable — try again later
Headers Reference
Request Headers
AcceptDesired response media types (e.g. application/json)
AuthorizationCredentials (Bearer token, Basic base64)
Content-TypeMedia type of request body
If-None-MatchConditional: ETag for cache validation
If-Modified-SinceConditional: date for cache validation
Cache-ControlCaching directives (no-cache, max-age)
User-AgentClient identification string
Response Headers
Content-TypeMedia type of response body
LocationRedirect target or created resource URL
ETagEntity tag for cache validation
Cache-ControlCaching directives (max-age, no-store)
Retry-AfterWait time before retrying (429/503)
WWW-AuthenticateAuth scheme required (sent with 401)
Set-CookieSet cookie on client
Common Patterns
Caching Flow
# First request — server returns ETag GET /api/data → 200, ETag: "abc123" # Subsequent request — conditional GET /api/data, If-None-Match: "abc123" → 304 Not Modified (use cache)
Auth Flow
# Unauthenticated request GET /api/secret → 401, WWW-Authenticate: Bearer # With token GET /api/secret, Authorization: Bearer → 200 OK
Rate Limiting
# Rate limited response 429 Too Many Requests Retry-After: 60 X-RateLimit-Remaining: 0 X-RateLimit-Reset: 1700000000
Content Negotiation
# Client prefers JSON, accepts XML Accept: application/json, application/xml;q=0.9 # Server can't satisfy → 406 Not Acceptable # Server returns best match → 200 + Content-Type