Coding

HTTP Status Codes You'll Actually Encounter

HTTP Status Codes You'll Actually Encounter

Cover: HTTP Status Codes You'll Actually Encounter

There are over 60 official HTTP status codes. In years of everyday web development, you'll mostly meet about a dozen of them — the rest are edge cases you can look up when they come up.

2xx: it worked

  • 200 OK — the standard success response.
  • 201 Created — a new resource was created, typically after a POST.
  • 204 No Content — succeeded, and there's nothing to send back (common after a DELETE).

3xx: go somewhere else

  • 301 Moved Permanently — this URL's content now lives elsewhere for good; update your bookmarks/links.
  • 302 Found — moved for now, but the original URL might be used again later.
  • 304 Not Modified — your cached copy is still accurate, no need to re-download.

4xx: the client made a mistake

  • 400 Bad Request — the request itself is malformed.
  • 401 Unauthorized — you need to log in.
  • 403 Forbidden — you're logged in, but not allowed to do this.
  • 404 Not Found — nothing exists at this URL.
  • 429 Too Many Requests — you're being rate-limited.

5xx: the server made a mistake

  • 500 Internal Server Error — something broke on the server, and it's not your fault.
  • 502 Bad Gateway — a server acting as a proxy got an invalid response from an upstream server.
  • 503 Service Unavailable — the server is overloaded or down for maintenance.
The fast triage rule: a 4xx means check what you sent; a 5xx means it's not on you — check the server logs instead.

Comments