HTTP Status Code Reference
Search and learn the meaning, typical cause and use case of every common HTTP status code, with cURL/Python/JS/PHP snippets.
100 Continue #
An interim response that signals the server has received the request headers and the client should proceed to send the request body. Defined in RFC 9110 section 15.2.1.
curl -i -X HEAD https://example.com/path # HTTP/1.1 100 Continue
import requests
r = requests.get("https://example.com/path")
if r.status_code == 100:
print("Continue")
const r = await fetch("https://example.com/path");
if (r.status === 100) {
console.log("Continue");
}
// Laravel / generic PHP return response()->json(['ok' => false], 100); // or: http_response_code(100);
101 Switching Protocols #
The server agrees to switch to a different application protocol on the same TCP connection, listed in the Upgrade header. RFC 9110 §15.2.2.
curl -i -X HEAD https://example.com/path # HTTP/1.1 101 Switching Protocols
import requests
r = requests.get("https://example.com/path")
if r.status_code == 101:
print("Switching Protocols")
const r = await fetch("https://example.com/path");
if (r.status === 101) {
console.log("Switching Protocols");
}
// Laravel / generic PHP return response()->json(['ok' => false], 101); // or: http_response_code(101);
200 OK #
Standard success response — the request succeeded and the response body carries the requested representation. RFC 9110 §15.3.1.
curl -i -X HEAD https://example.com/path # HTTP/1.1 200 OK
import requests
r = requests.get("https://example.com/path")
if r.status_code == 200:
print("OK")
const r = await fetch("https://example.com/path");
if (r.status === 200) {
console.log("OK");
}
// Laravel / generic PHP return response()->json(['ok' => false], 200); // or: http_response_code(200);
201 Created #
The request succeeded and a new resource was created as a direct result. The Location header SHOULD point to the new resource. RFC 9110 §15.3.2.
curl -i -X HEAD https://example.com/path # HTTP/1.1 201 Created
import requests
r = requests.get("https://example.com/path")
if r.status_code == 201:
print("Created")
const r = await fetch("https://example.com/path");
if (r.status === 201) {
console.log("Created");
}
// Laravel / generic PHP return response()->json(['ok' => false], 201); // or: http_response_code(201);
202 Accepted #
The request has been accepted for processing but is not yet complete. The processing may eventually succeed or fail. RFC 9110 §15.3.3.
curl -i -X HEAD https://example.com/path # HTTP/1.1 202 Accepted
import requests
r = requests.get("https://example.com/path")
if r.status_code == 202:
print("Accepted")
const r = await fetch("https://example.com/path");
if (r.status === 202) {
console.log("Accepted");
}
// Laravel / generic PHP return response()->json(['ok' => false], 202); // or: http_response_code(202);
204 No Content #
The request succeeded; the response intentionally has no body. Headers may carry metadata. RFC 9110 §15.3.5.
curl -i -X HEAD https://example.com/path # HTTP/1.1 204 No Content
import requests
r = requests.get("https://example.com/path")
if r.status_code == 204:
print("No Content")
const r = await fetch("https://example.com/path");
if (r.status === 204) {
console.log("No Content");
}
// Laravel / generic PHP return response()->json(['ok' => false], 204); // or: http_response_code(204);
206 Partial Content #
The server returned only part of the representation in response to a Range request. RFC 9110 §15.3.7.
curl -i -X HEAD https://example.com/path # HTTP/1.1 206 Partial Content
import requests
r = requests.get("https://example.com/path")
if r.status_code == 206:
print("Partial Content")
const r = await fetch("https://example.com/path");
if (r.status === 206) {
console.log("Partial Content");
}
// Laravel / generic PHP return response()->json(['ok' => false], 206); // or: http_response_code(206);
301 Moved Permanently #
The target resource has a new permanent URI. Clients SHOULD update bookmarks and search engines update their indexes. RFC 9110 §15.4.2.
curl -i -X HEAD https://example.com/path # HTTP/1.1 301 Moved Permanently
import requests
r = requests.get("https://example.com/path")
if r.status_code == 301:
print("Moved Permanently")
const r = await fetch("https://example.com/path");
if (r.status === 301) {
console.log("Moved Permanently");
}
// Laravel / generic PHP return response()->json(['ok' => false], 301); // or: http_response_code(301);
302 Found #
The target resource resides temporarily under a different URI. Clients should request the new URI without changing the method semantics, but historically most rewrite POST to GET. RFC 9110 §15.4.3.
curl -i -X HEAD https://example.com/path # HTTP/1.1 302 Found
import requests
r = requests.get("https://example.com/path")
if r.status_code == 302:
print("Found")
const r = await fetch("https://example.com/path");
if (r.status === 302) {
console.log("Found");
}
// Laravel / generic PHP return response()->json(['ok' => false], 302); // or: http_response_code(302);
303 See Other #
Redirects to a resource that should be retrieved with GET, regardless of the original method. RFC 9110 §15.4.4.
curl -i -X HEAD https://example.com/path # HTTP/1.1 303 See Other
import requests
r = requests.get("https://example.com/path")
if r.status_code == 303:
print("See Other")
const r = await fetch("https://example.com/path");
if (r.status === 303) {
console.log("See Other");
}
// Laravel / generic PHP return response()->json(['ok' => false], 303); // or: http_response_code(303);
304 Not Modified #
The cached representation the client already holds is still valid; no body is sent. RFC 9110 §15.4.5.
curl -i -X HEAD https://example.com/path # HTTP/1.1 304 Not Modified
import requests
r = requests.get("https://example.com/path")
if r.status_code == 304:
print("Not Modified")
const r = await fetch("https://example.com/path");
if (r.status === 304) {
console.log("Not Modified");
}
// Laravel / generic PHP return response()->json(['ok' => false], 304); // or: http_response_code(304);
307 Temporary Redirect #
Like 302 but explicitly preserves the request method and body. RFC 9110 §15.4.8.
curl -i -X HEAD https://example.com/path # HTTP/1.1 307 Temporary Redirect
import requests
r = requests.get("https://example.com/path")
if r.status_code == 307:
print("Temporary Redirect")
const r = await fetch("https://example.com/path");
if (r.status === 307) {
console.log("Temporary Redirect");
}
// Laravel / generic PHP return response()->json(['ok' => false], 307); // or: http_response_code(307);
308 Permanent Redirect #
Like 301 but explicitly preserves the request method and body. RFC 9110 §15.4.9.
curl -i -X HEAD https://example.com/path # HTTP/1.1 308 Permanent Redirect
import requests
r = requests.get("https://example.com/path")
if r.status_code == 308:
print("Permanent Redirect")
const r = await fetch("https://example.com/path");
if (r.status === 308) {
console.log("Permanent Redirect");
}
// Laravel / generic PHP return response()->json(['ok' => false], 308); // or: http_response_code(308);
400 Bad Request #
The server cannot process the request due to a client error: malformed syntax, invalid framing, deceptive routing. RFC 9110 §15.5.1.
curl -i -X HEAD https://example.com/path # HTTP/1.1 400 Bad Request
import requests
r = requests.get("https://example.com/path")
if r.status_code == 400:
print("Bad Request")
const r = await fetch("https://example.com/path");
if (r.status === 400) {
console.log("Bad Request");
}
// Laravel / generic PHP return response()->json(['ok' => false], 400); // or: http_response_code(400);
401 Unauthorized #
The request lacks valid authentication credentials. The response MUST include a WWW-Authenticate header listing accepted schemes. RFC 9110 §15.5.2.
curl -i -X HEAD https://example.com/path # HTTP/1.1 401 Unauthorized
import requests
r = requests.get("https://example.com/path")
if r.status_code == 401:
print("Unauthorized")
const r = await fetch("https://example.com/path");
if (r.status === 401) {
console.log("Unauthorized");
}
// Laravel / generic PHP return response()->json(['ok' => false], 401); // or: http_response_code(401);
403 Forbidden #
The server understood the request but refuses to authorise it. RFC 9110 §15.5.4.
curl -i -X HEAD https://example.com/path # HTTP/1.1 403 Forbidden
import requests
r = requests.get("https://example.com/path")
if r.status_code == 403:
print("Forbidden")
const r = await fetch("https://example.com/path");
if (r.status === 403) {
console.log("Forbidden");
}
// Laravel / generic PHP return response()->json(['ok' => false], 403); // or: http_response_code(403);
404 Not Found #
The server can’t find a current representation of the target resource. May also be used to hide a 403. RFC 9110 §15.5.5.
curl -i -X HEAD https://example.com/path # HTTP/1.1 404 Not Found
import requests
r = requests.get("https://example.com/path")
if r.status_code == 404:
print("Not Found")
const r = await fetch("https://example.com/path");
if (r.status === 404) {
console.log("Not Found");
}
// Laravel / generic PHP return response()->json(['ok' => false], 404); // or: http_response_code(404);
405 Method Not Allowed #
The method is not supported on the resource. The response MUST include an Allow header listing supported methods. RFC 9110 §15.5.6.
curl -i -X HEAD https://example.com/path # HTTP/1.1 405 Method Not Allowed
import requests
r = requests.get("https://example.com/path")
if r.status_code == 405:
print("Method Not Allowed")
const r = await fetch("https://example.com/path");
if (r.status === 405) {
console.log("Method Not Allowed");
}
// Laravel / generic PHP return response()->json(['ok' => false], 405); // or: http_response_code(405);
406 Not Acceptable #
The server cannot produce a representation matching the Accept-* headers. RFC 9110 §15.5.7.
curl -i -X HEAD https://example.com/path # HTTP/1.1 406 Not Acceptable
import requests
r = requests.get("https://example.com/path")
if r.status_code == 406:
print("Not Acceptable")
const r = await fetch("https://example.com/path");
if (r.status === 406) {
console.log("Not Acceptable");
}
// Laravel / generic PHP return response()->json(['ok' => false], 406); // or: http_response_code(406);
408 Request Timeout #
The server gave up waiting for the client to finish the request. RFC 9110 §15.5.9.
curl -i -X HEAD https://example.com/path # HTTP/1.1 408 Request Timeout
import requests
r = requests.get("https://example.com/path")
if r.status_code == 408:
print("Request Timeout")
const r = await fetch("https://example.com/path");
if (r.status === 408) {
console.log("Request Timeout");
}
// Laravel / generic PHP return response()->json(['ok' => false], 408); // or: http_response_code(408);
409 Conflict #
The request conflicts with the current state of the resource. RFC 9110 §15.5.10.
curl -i -X HEAD https://example.com/path # HTTP/1.1 409 Conflict
import requests
r = requests.get("https://example.com/path")
if r.status_code == 409:
print("Conflict")
const r = await fetch("https://example.com/path");
if (r.status === 409) {
console.log("Conflict");
}
// Laravel / generic PHP return response()->json(['ok' => false], 409); // or: http_response_code(409);
410 Gone #
The resource was intentionally removed and will not return. RFC 9110 §15.5.11.
curl -i -X HEAD https://example.com/path # HTTP/1.1 410 Gone
import requests
r = requests.get("https://example.com/path")
if r.status_code == 410:
print("Gone")
const r = await fetch("https://example.com/path");
if (r.status === 410) {
console.log("Gone");
}
// Laravel / generic PHP return response()->json(['ok' => false], 410); // or: http_response_code(410);
411 Length Required #
The request lacks a Content-Length header where the server requires one. RFC 9110 §15.5.12.
curl -i -X HEAD https://example.com/path # HTTP/1.1 411 Length Required
import requests
r = requests.get("https://example.com/path")
if r.status_code == 411:
print("Length Required")
const r = await fetch("https://example.com/path");
if (r.status === 411) {
console.log("Length Required");
}
// Laravel / generic PHP return response()->json(['ok' => false], 411); // or: http_response_code(411);
413 Content Too Large #
The request body is larger than the server is willing to accept. RFC 9110 §15.5.14. Renamed from "Payload Too Large" in RFC 9110.
curl -i -X HEAD https://example.com/path # HTTP/1.1 413 Content Too Large
import requests
r = requests.get("https://example.com/path")
if r.status_code == 413:
print("Content Too Large")
const r = await fetch("https://example.com/path");
if (r.status === 413) {
console.log("Content Too Large");
}
// Laravel / generic PHP return response()->json(['ok' => false], 413); // or: http_response_code(413);
414 URI Too Long #
The request URI is longer than the server is willing to interpret. RFC 9110 §15.5.15.
curl -i -X HEAD https://example.com/path # HTTP/1.1 414 URI Too Long
import requests
r = requests.get("https://example.com/path")
if r.status_code == 414:
print("URI Too Long")
const r = await fetch("https://example.com/path");
if (r.status === 414) {
console.log("URI Too Long");
}
// Laravel / generic PHP return response()->json(['ok' => false], 414); // or: http_response_code(414);
415 Unsupported Media Type #
The server refuses to accept the body in the format described by the Content-Type header. RFC 9110 §15.5.16.
curl -i -X HEAD https://example.com/path # HTTP/1.1 415 Unsupported Media Type
import requests
r = requests.get("https://example.com/path")
if r.status_code == 415:
print("Unsupported Media Type")
const r = await fetch("https://example.com/path");
if (r.status === 415) {
console.log("Unsupported Media Type");
}
// Laravel / generic PHP return response()->json(['ok' => false], 415); // or: http_response_code(415);
418 I’m a teapot #
An April-fools joke from RFC 2324 (HTCPCP). Some servers return it as a generic "refuse to brew" error. Not a real production status.
curl -i -X HEAD https://example.com/path # HTTP/1.1 418 I’m a teapot
import requests
r = requests.get("https://example.com/path")
if r.status_code == 418:
print("I’m a teapot")
const r = await fetch("https://example.com/path");
if (r.status === 418) {
console.log("I’m a teapot");
}
// Laravel / generic PHP return response()->json(['ok' => false], 418); // or: http_response_code(418);
422 Unprocessable Content #
The syntax is fine but the server can’t process the semantic content. RFC 9110 §15.5.21. Originally introduced by WebDAV (RFC 4918).
curl -i -X HEAD https://example.com/path # HTTP/1.1 422 Unprocessable Content
import requests
r = requests.get("https://example.com/path")
if r.status_code == 422:
print("Unprocessable Content")
const r = await fetch("https://example.com/path");
if (r.status === 422) {
console.log("Unprocessable Content");
}
// Laravel / generic PHP return response()->json(['ok' => false], 422); // or: http_response_code(422);
423 Locked #
The resource is locked. RFC 4918 (WebDAV).
curl -i -X HEAD https://example.com/path # HTTP/1.1 423 Locked
import requests
r = requests.get("https://example.com/path")
if r.status_code == 423:
print("Locked")
const r = await fetch("https://example.com/path");
if (r.status === 423) {
console.log("Locked");
}
// Laravel / generic PHP return response()->json(['ok' => false], 423); // or: http_response_code(423);
425 Too Early #
The server is unwilling to process a request that might be replayed, typically because it was sent in TLS 1.3 0-RTT (early data). RFC 8470.
curl -i -X HEAD https://example.com/path # HTTP/1.1 425 Too Early
import requests
r = requests.get("https://example.com/path")
if r.status_code == 425:
print("Too Early")
const r = await fetch("https://example.com/path");
if (r.status === 425) {
console.log("Too Early");
}
// Laravel / generic PHP return response()->json(['ok' => false], 425); // or: http_response_code(425);
428 Precondition Required #
The origin server requires the request to be conditional. RFC 6585.
curl -i -X HEAD https://example.com/path # HTTP/1.1 428 Precondition Required
import requests
r = requests.get("https://example.com/path")
if r.status_code == 428:
print("Precondition Required")
const r = await fetch("https://example.com/path");
if (r.status === 428) {
console.log("Precondition Required");
}
// Laravel / generic PHP return response()->json(['ok' => false], 428); // or: http_response_code(428);
429 Too Many Requests #
The user has sent too many requests in a given time. RFC 6585.
curl -i -X HEAD https://example.com/path # HTTP/1.1 429 Too Many Requests
import requests
r = requests.get("https://example.com/path")
if r.status_code == 429:
print("Too Many Requests")
const r = await fetch("https://example.com/path");
if (r.status === 429) {
console.log("Too Many Requests");
}
// Laravel / generic PHP return response()->json(['ok' => false], 429); // or: http_response_code(429);
431 Request Header Fields Too Large #
The server refuses to process the request because its header fields are too large. RFC 6585.
curl -i -X HEAD https://example.com/path # HTTP/1.1 431 Request Header Fields Too Large
import requests
r = requests.get("https://example.com/path")
if r.status_code == 431:
print("Request Header Fields Too Large")
const r = await fetch("https://example.com/path");
if (r.status === 431) {
console.log("Request Header Fields Too Large");
}
// Laravel / generic PHP return response()->json(['ok' => false], 431); // or: http_response_code(431);
451 Unavailable For Legal Reasons #
The resource is unavailable due to legal demands — a takedown order, geo-block, or DMCA. RFC 7725.
curl -i -X HEAD https://example.com/path # HTTP/1.1 451 Unavailable For Legal Reasons
import requests
r = requests.get("https://example.com/path")
if r.status_code == 451:
print("Unavailable For Legal Reasons")
const r = await fetch("https://example.com/path");
if (r.status === 451) {
console.log("Unavailable For Legal Reasons");
}
// Laravel / generic PHP return response()->json(['ok' => false], 451); // or: http_response_code(451);
500 Internal Server Error #
The server encountered an unexpected condition that prevented it from fulfilling the request. RFC 9110 §15.6.1.
curl -i -X HEAD https://example.com/path # HTTP/1.1 500 Internal Server Error
import requests
r = requests.get("https://example.com/path")
if r.status_code == 500:
print("Internal Server Error")
const r = await fetch("https://example.com/path");
if (r.status === 500) {
console.log("Internal Server Error");
}
// Laravel / generic PHP return response()->json(['ok' => false], 500); // or: http_response_code(500);
501 Not Implemented #
The server does not support the functionality required to fulfil the request. RFC 9110 §15.6.2.
curl -i -X HEAD https://example.com/path # HTTP/1.1 501 Not Implemented
import requests
r = requests.get("https://example.com/path")
if r.status_code == 501:
print("Not Implemented")
const r = await fetch("https://example.com/path");
if (r.status === 501) {
console.log("Not Implemented");
}
// Laravel / generic PHP return response()->json(['ok' => false], 501); // or: http_response_code(501);
502 Bad Gateway #
The gateway or proxy got an invalid response from the upstream server. RFC 9110 §15.6.3.
curl -i -X HEAD https://example.com/path # HTTP/1.1 502 Bad Gateway
import requests
r = requests.get("https://example.com/path")
if r.status_code == 502:
print("Bad Gateway")
const r = await fetch("https://example.com/path");
if (r.status === 502) {
console.log("Bad Gateway");
}
// Laravel / generic PHP return response()->json(['ok' => false], 502); // or: http_response_code(502);
503 Service Unavailable #
The server is currently unable to handle the request, typically due to maintenance or overload. RFC 9110 §15.6.4.
curl -i -X HEAD https://example.com/path # HTTP/1.1 503 Service Unavailable
import requests
r = requests.get("https://example.com/path")
if r.status_code == 503:
print("Service Unavailable")
const r = await fetch("https://example.com/path");
if (r.status === 503) {
console.log("Service Unavailable");
}
// Laravel / generic PHP return response()->json(['ok' => false], 503); // or: http_response_code(503);
504 Gateway Timeout #
The gateway or proxy did not get a timely response from the upstream server. RFC 9110 §15.6.5.
curl -i -X HEAD https://example.com/path # HTTP/1.1 504 Gateway Timeout
import requests
r = requests.get("https://example.com/path")
if r.status_code == 504:
print("Gateway Timeout")
const r = await fetch("https://example.com/path");
if (r.status === 504) {
console.log("Gateway Timeout");
}
// Laravel / generic PHP return response()->json(['ok' => false], 504); // or: http_response_code(504);
505 HTTP Version Not Supported #
The server does not support the major HTTP version of the request. RFC 9110 §15.6.6.
curl -i -X HEAD https://example.com/path # HTTP/1.1 505 HTTP Version Not Supported
import requests
r = requests.get("https://example.com/path")
if r.status_code == 505:
print("HTTP Version Not Supported")
const r = await fetch("https://example.com/path");
if (r.status === 505) {
console.log("HTTP Version Not Supported");
}
// Laravel / generic PHP return response()->json(['ok' => false], 505); // or: http_response_code(505);
511 Network Authentication Required #
The client must authenticate to use the network — typically a captive portal. RFC 6585.
curl -i -X HEAD https://example.com/path # HTTP/1.1 511 Network Authentication Required
import requests
r = requests.get("https://example.com/path")
if r.status_code == 511:
print("Network Authentication Required")
const r = await fetch("https://example.com/path");
if (r.status === 511) {
console.log("Network Authentication Required");
}
// Laravel / generic PHP return response()->json(['ok' => false], 511); // or: http_response_code(511);
What are HTTP status codes?
An HTTP status code is the three-digit number a server returns at the start of every response. It groups into five families: 1xx informational, 2xx success, 3xx redirection, 4xx client error and 5xx server error. The codes are defined in RFC 9110 (the consolidated 2022 spec replacing the older 7230–7235 series), with extensions in RFC 6585 (additional 4xx/5xx), RFC 7725 (451), RFC 4918 (WebDAV) and RFC 8470 (425). Reading the status correctly is the difference between fixing a bug in five minutes and chasing a ghost for an afternoon: a 404 from your CDN means the path is wrong, a 502 from your proxy means the application crashed, and a 401 with no WWW-Authenticate header is a misconfigured backend. This page is a searchable cheat sheet — each card includes the official name, an RFC-grounded description, the typical cause and concrete code snippets you can paste into curl, Python, JavaScript or PHP.
How to use the reference
Type a code or part of a name in the search box, or filter by family using the chips. Each card opens to reveal the technical description, common causes and a tabbed snippet you can adapt. Every code has its own anchor (e.g. #404) so you can deep-link team docs straight to a specific status.
Status code families at a glance
| Range | Family | Meaning |
|---|---|---|
| 1xx | Informational | Provisional responses; rarely seen at the application layer. |
| 2xx | Success | Request was received, understood and accepted. |
| 3xx | Redirection | Further action is needed (a different URL, cache validation, etc.). |
| 4xx | Client error | The request had a problem (bad input, missing auth, wrong method). |
| 5xx | Server error | The server failed to fulfil an apparently valid request. |
EN
PT
ES