Skip to main content

Reference

HTTP Status Codes

A searchable reference of HTTP status codes with short guidance on when to use each one and how it differs from the codes people confuse it with.

Runs in your browser. Nothing is uploaded.

1xx · Informational

100

Continue

The server got the headers; send the body. Used with Expect: 100-continue for large uploads.

101

Switching Protocolscommon

Sent when upgrading the connection, most often to WebSocket.

103

Early Hints

Lets the browser start preloading resources (Link headers) before the final response is ready.

2xx · Success

200

OKcommon

Generic success. The body contains the result.

201

Createdcommon

A resource was created. Include a Location header pointing at it.

202

Accepted

Request accepted for asynchronous processing that hasn't finished. Return a way to poll for the outcome.

203

Non-Authoritative Information

A proxy modified the origin's 200 response. Rare.

204

No Contentcommon

Success with no body. Typical for DELETE or a PUT that returns nothing.

205

Reset Content

Success; the client should reset the form/view that sent the request.

206

Partial Content

Response to a Range request: video seeking, resumable downloads.

207

Multi-Status

WebDAV: the body holds status for multiple resources.

3xx · Redirection

300

Multiple Choices

Several representations available. Browsers don't do anything useful with it.

301

Moved Permanentlycommon

Permanent redirect, cached aggressively. Clients may change POST to GET; use 308 to forbid that.

302

Foundcommon

Temporary redirect. Historically turns POST into GET; 303/307 say what you mean.

303

See Other

Redirect that must be followed with GET. The classic Post/Redirect/Get after a form submit.

304

Not Modifiedcommon

Conditional GET hit: the cached copy (ETag / Last-Modified) is still valid. No body.

307

Temporary Redirect

Like 302 but the method and body must be kept.

308

Permanent Redirect

Like 301 but the method and body must be kept.

4xx · Client error

400

Bad Requestcommon

Malformed request: invalid JSON, missing fields, bad syntax. Use 422 if the syntax is fine but the values aren't.

401

Unauthorizedcommon

Actually means unauthenticated: no or invalid credentials. Must include WWW-Authenticate.

402

Payment Required

Reserved; some APIs use it for exhausted quotas or billing problems.

403

Forbiddencommon

Authenticated but not allowed. Re-authenticating won't help (unlike 401).

404

Not Foundcommon

No resource here. Also used instead of 403 to avoid revealing that something exists.

405

Method Not Allowedcommon

The resource exists but not for this verb. Include an Allow header.

406

Not Acceptable

Can't produce a representation matching the Accept headers.

407

Proxy Authentication Required

Like 401, but for a proxy.

408

Request Timeout

The client took too long to send the request. Safe to retry.

409

Conflictcommon

Conflicts with the current state: duplicate unique key, edit conflict, version mismatch.

410

Gone

Deleted on purpose and not coming back. Search engines drop it faster than a 404.

411

Length Required

The server requires a Content-Length header.

412

Precondition Failed

An If-Match / If-Unmodified-Since check failed. Optimistic locking.

413

Content Too Largecommon

Body exceeds the server limit (think nginx client_max_body_size).

414

URI Too Long

The URL is too long. Usually a GET that should have been a POST.

415

Unsupported Media Typecommon

The Content-Type isn't supported, e.g. sending form data to a JSON-only endpoint.

416

Range Not Satisfiable

The requested Range lies outside the resource.

417

Expectation Failed

The server can't meet the Expect header.

418

I'm a teapot

An April Fools' joke (RFC 2324) that never went away. Refuses to brew coffee.

421

Misdirected Request

The request reached a server that can't answer for this host. Seen with HTTP/2 connection reuse.

422

Unprocessable Contentcommon

Well-formed but semantically invalid: validation errors. The usual choice for form errors in APIs.

423

Locked

WebDAV: the resource is locked.

424

Failed Dependency

WebDAV: failed because a previous request failed.

425

Too Early

The server won't risk processing a request that might be replayed (TLS early data).

426

Upgrade Required

The client must switch protocols, given in the Upgrade header.

428

Precondition Required

The server requires conditional requests to prevent lost updates.

429

Too Many Requestscommon

Rate limited. Send Retry-After so clients know when to come back.

431

Request Header Fields Too Large

Headers too big. Often too many or too large cookies.

451

Unavailable For Legal Reasons

Blocked for legal reasons such as censorship or a court order. A nod to Fahrenheit 451.

499

Client Closed Request

Non-standard (nginx): the client hung up before the server answered.

5xx · Server error

500

Internal Server Errorcommon

Generic server failure, usually an unhandled exception. Check the logs.

501

Not Implemented

The server doesn't support the functionality (e.g. an unknown method).

502

Bad Gatewaycommon

A proxy got an invalid response from upstream. Usually your app crashed or isn't listening.

503

Service Unavailablecommon

Overloaded or down for maintenance. Add Retry-After.

504

Gateway Timeoutcommon

A proxy gave up waiting for upstream. Your app is too slow or stuck.

505

HTTP Version Not Supported

The HTTP version in the request isn't supported.

507

Insufficient Storage

WebDAV: no space left to store the representation.

508

Loop Detected

WebDAV: infinite loop while processing.

511

Network Authentication Required

Captive portal: log in to the network (hotel / airport wifi) first.

520

Web Server Returned an Unknown Error

Cloudflare: the origin returned something empty or unexpected.

521

Web Server Is Down

Cloudflare: the origin refused the connection.

522

Connection Timed Out

Cloudflare: the TCP connection to the origin timed out.

524

A Timeout Occurred

Cloudflare: connected to the origin but it didn't respond within 100 seconds.

esc