MockFoxAdvertise

HTTP status codes

Updated Free mock REST & WebSocket APIs

Every HTTP response starts with a three-digit status code telling the client what happened. Search the complete list below — each code has its own page with what it means, common causes, how to fix it and copy-paste server examples.

1xx Informational

Interim responses: the request was received and processing continues.

2xx Success

The request was received, understood and accepted.

3xx Redirection

Further action (usually following a Location header) is needed to complete the request.

4xx Client Error

The request contains an error or can't be fulfilled — fix the request before retrying.

5xx Server Error

The server failed to fulfill a valid request — usually temporary, or a server-side bug.

The five classes of status codes

RangeClassMeaning
1xxInformationalInterim responses: the request was received and processing continues.
2xxSuccessThe request was received, understood and accepted.
3xxRedirectionFurther action (usually following a Location header) is needed to complete the request.
4xxClient ErrorThe request contains an error or can't be fulfilled — fix the request before retrying.
5xxServer ErrorThe server failed to fulfill a valid request — usually temporary, or a server-side bug.

Clients that don't recognise a code must treat it like the x00 code of its class — an unknown 499 is handled like 400 — which is why vendors can add their own codes.

Cheat sheet: the codes you'll actually see

CodeNameIn one line
200OKThe request succeeded and the response contains the result.
201CreatedThe request succeeded and created a new resource, usually identified by the Location header.
204No ContentThe request succeeded and there is intentionally no response body.
301Moved PermanentlyThe resource has a new permanent URL, given in the Location header.
302FoundThe resource is temporarily at a different URL, given in the Location header.
304Not ModifiedThe cached copy the client already has is still valid, so no body is sent.
400Bad RequestThe server can't process the request because it's malformed or invalid.
401UnauthorizedThe request lacks valid authentication credentials; it must include a WWW-Authenticate challenge.
403ForbiddenThe server understood the request but refuses to authorize it.
404Not FoundThe server can't find anything at the requested URL.
405Method Not AllowedThe URL exists but doesn't support the HTTP method used; the Allow header lists the ones it does.
409ConflictThe request conflicts with the current state of the resource.
422Unprocessable ContentThe request is well-formed, but its contents fail validation.
429Too Many RequestsThe client sent too many requests in a given time (rate limiting).
500Internal Server ErrorThe server hit an unexpected condition that prevented it from fulfilling the request.
502Bad GatewayA gateway or proxy got an invalid response from the upstream server.
503Service UnavailableThe server is temporarily unable to handle the request (overload or maintenance).
504Gateway TimeoutA gateway or proxy didn't get a response from the upstream server in time.

How to check the status code of a URL

  1. Browser: open DevTools (F12) → Network tab, reload, and read the Status column. Click a request to see all response headers.
  2. Terminal: curl -I https://example.com prints the status line and headers; add -L to follow redirects and see every hop.
  3. JavaScript: const res = await fetch(url); console.log(res.status, res.ok); — res.ok is true for 200–299.
  4. Test your error handling: point your app at https://mockfox.dev/api/status/503 (any code 200–599) to see how it behaves.

Choosing the right code for your API

  • Created something? 201 with a Location header. Nothing to return? 204.
  • Malformed request → 400; valid JSON that fails validation → 422; duplicate or version conflict → 409.
  • Not logged in → 401; logged in but not allowed → 403.
  • Rate limited → 429 with Retry-After; down for maintenance → 503.

Related tools

Frequently asked questions

How many HTTP status codes are there?

The IANA registry lists around 60 assigned codes from 100 to 511. This list also covers common unofficial codes used by nginx (444, 499), Cloudflare (520–530) and Laravel (419).

What are the most common HTTP status codes?

200 OK, 301/302 redirects, 304 Not Modified, 404 Not Found and 500 Internal Server Error make up the vast majority of web traffic. APIs also frequently return 201, 204, 400, 401, 403, 422 and 429.

How do I check a page's status code?

Open the browser DevTools Network tab and look at the Status column, or run curl -I https://example.com in a terminal to print just the status line and headers.

What's the difference between 4xx and 5xx errors?

4xx codes mean the server thinks the request is at fault (bad URL, missing auth, invalid data). 5xx codes mean the server failed to handle a request that may be valid.

Can I get a test URL that returns a specific status code?

Yes: https://mockfox.dev/api/status/{code} returns that status (200–599) for any method, with CORS enabled. Add ?delay=ms for latency and ?location=/path for redirects.