Skip to main content
HomeTools

HTTP Status Code Reference

Free

Interactive HTTP status code reference. Search by code or description, filter by category (1xx–5xx), get meaning, common causes, and ready-to-use assertion snippets for Playwright, RestAssured, and pytest.

#http#status-code#api-testing#rest#assertions
Showing 48 status codes
100Continue
Informational

Server received headers, client should send body.

Common Causes
  • •Large file uploads
  • •Expect: 100-continue header
Assertion Tip
Rarely asserted directly. Check if client proceeds with body.
101Switching Protocols
Informational

Server switching to protocol requested via Upgrade header.

Common Causes
  • •WebSocket upgrade
Assertion Tip
Assert 101 when testing WebSocket connections.
102Processing
Informational

Server received and is processing, but no response yet.

Common Causes
  • •Long-running WebDAV operations
Assertion Tip
Used in WebDAV. Rarely tested in REST APIs.
200OK
Success

Request succeeded. Standard response for successful requests.

Common Causes
  • •GET/PUT/PATCH successful
Assertion Tip
expect(response.status).toBe(200)
201Created
Success

Request succeeded and a new resource was created.

Common Causes
  • •POST creating a resource
Assertion Tip
Assert 201 on POST. Check Location header for new resource URL.
202Accepted
Success

Request accepted for processing, but not completed yet.

Common Causes
  • •Async job queued
  • •Webhook accepted
Assertion Tip
Assert 202 for async operations. Poll for completion.
203Non-Authoritative Information
Success

Response was modified by a proxy or transforming intermediary.

Common Causes
  • •Transforming proxy in the path
  • •Content optimisation gateway
Assertion Tip
Rarely asserted. If you see it in tests, a proxy is rewriting your payload.
204No Content
Success

Request succeeded, but no response body.

Common Causes
  • •DELETE successful
  • •PUT with no return body
Assertion Tip
Assert 204 on DELETE. Verify body is empty.
205Reset Content
Success

Request succeeded; the client should reset its document view.

Common Causes
  • •Form submission that clears the form
Assertion Tip
Assert the body is empty. Almost never used in REST APIs.
206Partial Content
Success

Server returning partial resource due to Range header.

Common Causes
  • •Video streaming
  • •Large file download resume
Assertion Tip
Assert Content-Range header is present.
300Multiple Choices
Redirect

More than one representation is available; the client chooses.

Common Causes
  • •Content negotiation with no preferred variant
Assertion Tip
Assert the body lists the alternatives. Rare in practice.
301Moved Permanently
Redirect

Resource permanently moved to new URL.

Common Causes
  • •URL restructuring
  • •HTTP→HTTPS redirect
Assertion Tip
Assert Location header. Test that clients follow redirect.
302Found
Redirect

Resource temporarily at different URL.

Common Causes
  • •Login redirect
  • •Temporary maintenance page
Assertion Tip
Assert Location header. Common after form submissions.
303See Other
Redirect

Fetch the result of the request from another URI using GET.

Common Causes
  • •POST-redirect-GET after a form submission
  • •Async job pointing at its result
Assertion Tip
Assert 303 for POST-redirect-GET. Unlike 307, the follow-up must be a GET.
304Not Modified
Redirect

Cached version is still valid. No body returned.

Common Causes
  • •Conditional GET with If-None-Match/If-Modified-Since
Assertion Tip
Assert 304 with ETag/Last-Modified headers in caching tests.
307Temporary Redirect
Redirect

Like 302, but method and body must not change.

Common Causes
  • •HTTPS redirect preserving POST method
Assertion Tip
Assert original method is preserved after redirect.
308Permanent Redirect
Redirect

Like 301, but method and body must not change.

Common Causes
  • •Permanent URL change preserving POST
Assertion Tip
Assert method preservation. Test with non-GET methods.
400Bad Request
Client

Server cannot process due to client error (malformed syntax).

Common Causes
  • •Invalid JSON body
  • •Missing required field
  • •Wrong data type
Assertion Tip
Assert 400 for validation tests. Check error message in body.
401Unauthorized
Client

Authentication required or credentials invalid.

Common Causes
  • •Missing auth token
  • •Expired JWT
  • •Invalid API key
Assertion Tip
Assert 401 without credentials. Test expired token handling.
402Payment Required
Client

Reserved for payment-gated access; used by some metered APIs.

Common Causes
  • •Subscription lapsed
  • •Usage quota needs topping up
Assertion Tip
Assert 402 in billing and plan-limit tests where the API uses it.
403Forbidden
Client

Server understood request but refuses to authorize it.

Common Causes
  • •Insufficient permissions
  • •IP blocked
  • •CORS denied
Assertion Tip
Assert 403 for role-based access control tests.
404Not Found
Client

Server cannot find the requested resource.

Common Causes
  • •Wrong URL
  • •Deleted resource
  • •Typo in endpoint
Assertion Tip
Assert 404 for deleted resources and invalid endpoints.
405Method Not Allowed
Client

HTTP method not supported for this endpoint.

Common Causes
  • •PUT on read-only endpoint
  • •DELETE not allowed
Assertion Tip
Assert 405 when sending wrong HTTP method. Also assert the Allow header.
406Not Acceptable
Client

No representation matches the request's Accept headers.

Common Causes
  • •Accept: application/xml on a JSON-only endpoint
  • •Unsupported Accept-Language
Assertion Tip
Assert 406 in content-negotiation tests by sending an unsupported Accept.
407Proxy Authentication Required
Client

The client must authenticate with the proxy first.

Common Causes
  • •Corporate proxy in CI
  • •Missing proxy credentials in the runner
Assertion Tip
Seeing this in CI usually means the runner's proxy config is missing, not an API bug.
408Request Timeout
Client

The server closed an idle connection while waiting for the request.

Common Causes
  • •Client sent headers then stalled
  • •Keep-alive idle timeout reached
Assertion Tip
Assert 408 in slow-client tests. Distinguish it from 504, which is an upstream timeout.
409Conflict
Client

Request conflicts with current server state.

Common Causes
  • •Duplicate entry
  • •Concurrent update conflict
Assertion Tip
Assert 409 for duplicate creation or optimistic locking.
410Gone
Client

The resource existed and has been permanently removed.

Common Causes
  • •Deliberately retired endpoint
  • •Hard-deleted resource with a tombstone
Assertion Tip
Assert 410 rather than 404 when a deletion is permanent and you want clients to stop retrying.
411Length Required
Client

The server refuses the request without a Content-Length header.

Common Causes
  • •Streaming a body without a length
  • •Chunked upload to an endpoint that requires a length
Assertion Tip
Assert 411 when posting a body with no Content-Length.
412Precondition Failed
Client

A conditional header did not match the current resource state.

Common Causes
  • •If-Match ETag no longer current
  • •Lost-update protection triggered
Assertion Tip
Assert 412 in optimistic-concurrency tests: read an ETag, change the resource, then PUT with the stale If-Match.
413Content Too Large
Client

Request body exceeds server limits. Called "Payload Too Large" before RFC 9110.

Common Causes
  • •File upload too large
  • •Body size limit reached
Assertion Tip
Assert 413 with oversized payloads in boundary tests.
414URI Too Long
Client

The request target is longer than the server will accept.

Common Causes
  • •Filter or query params serialised into the URL
  • •GET used where POST was needed
Assertion Tip
Assert 414 in boundary tests on endpoints that take long query strings.
415Unsupported Media Type
Client

Content-Type not supported by the endpoint.

Common Causes
  • •Sending XML to JSON-only endpoint
  • •Missing Content-Type header
Assertion Tip
Assert 415 with wrong Content-Type header.
416Range Not Satisfiable
Client

The requested Range lies outside the resource.

Common Causes
  • •Resume offset past end of file
  • •Range header on a zero-length resource
Assertion Tip
Assert 416 in download-resume tests with an out-of-bounds Range.
417Expectation Failed
Client

The Expect header cannot be met by the server.

Common Causes
  • •Expect: 100-continue through a proxy that will not honour it
Assertion Tip
Assert 417 when testing large uploads that negotiate with Expect.
421Misdirected Request
Client

The request reached a server that cannot serve this authority.

Common Causes
  • •HTTP/2 connection coalescing across hosts
  • •Wrong SNI / certificate reuse
Assertion Tip
Usually infrastructure, not the API. Check which host actually terminated the connection.
422Unprocessable Content
Client

Request well-formed but semantically invalid. Called "Unprocessable Entity" before RFC 9110.

Common Causes
  • •Business rule violation
  • •Invalid field value
Assertion Tip
Assert 422 for semantic validation. Popular in REST APIs.
426Upgrade Required
Client

The client must switch protocols to continue.

Common Causes
  • •Endpoint requires TLS
  • •WebSocket-only endpoint hit over plain HTTP
Assertion Tip
Assert the Upgrade header names the protocol the server expects.
428Precondition Required
Client

The server requires the request to be conditional.

Common Causes
  • •PUT without If-Match on an endpoint that forbids blind overwrites
Assertion Tip
Assert 428 to prove the API refuses unconditional writes. Pairs with 412.
429Too Many Requests
Client

Rate limit exceeded.

Common Causes
  • •API rate limiting
  • •DDoS protection
Assertion Tip
Assert 429 in rate limit tests. Check Retry-After header.
431Request Header Fields Too Large
Client

The request's headers are collectively or individually too large.

Common Causes
  • •Oversized cookie jar
  • •A very long Authorization or trace header
Assertion Tip
Assert 431 in boundary tests that grow a header until it is rejected.
451Unavailable For Legal Reasons
Client

Access denied because of a legal demand.

Common Causes
  • •Geo-blocking for regulatory reasons
  • •Takedown notice
Assertion Tip
Assert 451 in geo/compliance tests where the API distinguishes it from 403.
500Internal Server Error
Server

Unexpected server error.

Common Causes
  • •Unhandled exception
  • •Database down
  • •Bug in server code
Assertion Tip
Should NOT appear in happy-path tests. Log and investigate.
501Not Implemented
Server

The server does not support the functionality required.

Common Causes
  • •Method recognised but never implemented
  • •Feature behind a flag that is off
Assertion Tip
Assert 501 for endpoints that are declared but not built. Unlike 405, this is about the server, not the route.
502Bad Gateway
Server

Server got invalid response from upstream.

Common Causes
  • •Upstream service down
  • •Proxy misconfiguration
Assertion Tip
Assert 502 in service mesh / gateway tests.
503Service Unavailable
Server

Server temporarily unable to handle requests.

Common Causes
  • •Maintenance mode
  • •Server overloaded
Assertion Tip
Assert 503 during maintenance window tests.
504Gateway Timeout
Server

Server didn't get response from upstream in time.

Common Causes
  • •Slow upstream service
  • •Network timeout
Assertion Tip
Assert 504 in timeout and resilience tests.
505HTTP Version Not Supported
Server

The server refuses the request's HTTP version.

Common Causes
  • •Client forced to HTTP/2 against an HTTP/1.1-only origin
Assertion Tip
Assert this when pinning protocol versions in client compatibility tests.
Frequently Asked Questions(click to expand)

What is the difference between 401 and 403?

401 (Unauthorized) means the client has not provided valid authentication credentials. 403 (Forbidden) means the client is authenticated but does not have permission to access the resource.

When should I use 200 vs 201 vs 204?

Use 200 for successful GET/PUT/PATCH requests that return data. Use 201 for POST requests that create a new resource. Use 204 for DELETE or actions that succeed but return no body.