utilitech

HTTP Status Codes

Every HTTP status code explained — what it means, when to use it and how to fix it — searchable by number or name.

1xx Informational Request received, keep going

2xx Success The request worked

3xx Redirection Look somewhere else

4xx Client error Something is wrong with the request

  • Also used to hide resources the user isn't allowed to know about.

    What to do: Check the URL for typos, trailing slashes and letter case. Redirect (301) old URLs that moved.

5xx Server error The server failed to handle a valid request

How to use
  • Search by number (404), by class (5xx) or by words such as timeout or redirect. Click a code for details and how to fix it.
  • Link straight to a code by adding its number, e.g. /tools/http-status#502.
Choosing codes for an API
  • 401 vs 403: 401 means “who are you?” (log in), 403 means “I know who you are, and no” (no permission).
  • 400 vs 422: 400 for a request that can't be read at all (broken JSON), 422 for readable data that fails validation.
  • 301 vs 302 vs 307/308: 301/308 are permanent (SEO moves to the new URL), 302/307 are temporary. 307 and 308 keep the method — a POST stays a POST.
  • 502 vs 504: 502 means the app behind the proxy answered badly or not at all; 504 means it answered too slowly.