← Cheat Sheets

HTTP Status Codes Cheat Sheet

Every HTTP response carries a three-digit status. The first digit is the family: 1xx informational, 2xx success, 3xx redirect, 4xx you messed up, 5xx the server messed up.

2xx — Success

CodeNameWhen you see it
200OKStandard success — page loaded, GET returned data
201CreatedPOST created a resource (new record, uploaded file)
204No ContentSuccess with an empty body — common for DELETE

3xx — Redirects

CodeNameWhen you see it
301Moved PermanentlyURL changed for good; browsers and search engines cache it
302FoundTemporary redirect — do not use for moved content
304Not ModifiedClient cache is still valid; body not resent

4xx — Client errors

CodeNameWhen you see it
400Bad RequestMalformed syntax — invalid JSON, bad parameters
401UnauthorizedNot authenticated (no/invalid credentials) — log in first
403ForbiddenAuthenticated but not allowed — do not retry as-is
404Not FoundNo resource at this URL
409ConflictRequest contradicts current state (duplicate, version clash)
422Unprocessable EntityWell-formed but semantically invalid (validation failed)
429Too Many RequestsRate limit hit — back off, honor Retry-After

5xx — Server errors

CodeNameWhen you see it
500Internal Server ErrorUnhandled exception on the server — check the logs
502Bad GatewayUpstream service returned garbage or died
503Service UnavailableOverloaded or in maintenance — usually temporary
504Gateway TimeoutUpstream took too long to answer

FAQ

401 vs 403 — both mean "no", right?
401 = "who are you?" (missing or invalid authentication). 403 = "I know who you are and you still can't". Retrying 403 with the same credentials never helps.

301 vs 302 for SEO?
301 passes ranking signals to the new URL and browsers cache it aggressively. Use 302 only when the move is truly temporary — search engines keep the old URL indexed.

I got a 429 — what now?
Slow down. Read the Retry-After header if present, add exponential backoff, and batch requests. Hammering a rate-limited endpoint turns 429 into 403.