This document provides a full list of HTTP status codes. Each code includes an explanation and a use case for better understanding.
- Informational Responses (100–199)
- Successful Responses (200–299)
- Redirection Messages (300–399)
- Client Error Responses (400–499)
- Server Error Responses (500–599)
- Description: Indicates that the initial part of a request has been received and the client can continue.
- Example: Client uploads a large file and receives
100 Continue
, signaling it to send the remaining data.
- Description: Server is switching protocols as requested by the client.
- Example: A client requests an upgrade from HTTP to WebSocket for real-time communication.
- Description: Server is processing a WebDAV request but has not completed it.
- Example: Complex WebDAV request for a file search receives
102 Processing
to avoid timeouts.
- Description: Used to pre-load resources before the final response is ready.
- Example: Server sends
103 Early Hints
to preload CSS and images for a page.
- Description: Request was successful, and the response contains the requested data.
- Example: A browser loads a webpage or an API fetch request returns successfully.
- Description: Resource was successfully created.
- Example: A new user account created after form submission.
- Description: Request accepted for processing, but not yet completed.
- Example: Report generation request in a system that processes it in the background.
- Description: Request successful, but response is from a cached or third-party source.
- Example: Proxy server returns cached content without directly fetching the latest data.
- Description: Request was successful but there is no content to return.
- Example: User updates profile settings, and the server acknowledges without additional data.
- Description: Client should reset the view.
- Example: After submitting data, a form resets for new entries.
- Description: Partial response for a range request.
- Example: Resuming a paused video or file download from a specific byte range.
- Description: Conveys multiple status codes for multiple independent operations.
- Example: WebDAV requests return multiple statuses for each sub-operation on files.
- Description: Used to avoid reporting the same resource multiple times.
- Example: WebDAV responses that include previously processed elements.
- Description: Server fulfilled a GET request with the instance manipulations applied.
- Example: A response indicating a resource has been manipulated (e.g., compressed) before delivery.
- Description: Indicates multiple options for the resource.
- Example: User can choose between multiple file formats or language versions.
- Description: Resource has a new permanent URL.
- Example: Permanently moved page, updating search engines and bookmarks.
- Description: Temporary redirect to another resource.
- Example: Redirect to a login page from a protected resource.
- Description: Redirects to a different resource using GET.
- Example: Redirect to a receipt page after submitting a purchase order.
- Description: Indicates cached content is up to date.
- Example: Browser cache check for an image returns
304
if unchanged.
- Description: Requested resource must be accessed through a proxy.
- Example: Deprecated in HTTP/1.1 due to security concerns.
- Description: Previously reserved, but not used.
- Description: Similar to
302
but method remains the same. - Example: Temporarily redirects a POST request without changing method.
- Description: Similar to
301
but method remains the same. - Example: API endpoint moved permanently; clients should update the URI.
- Description: The server could not understand the request.
- Example: Malformed JSON payload in an API request.
- Description: Authentication is required but missing or invalid.
- Example: API request without a valid authentication token.
- Description: Reserved for future use regarding digital payment.
- Example: Possible future status for subscription services.
- Description: Client has no access rights to the content.
- Example: Unauthorized user attempts access to an admin-only page.
- Description: Server cannot find the requested resource.
- Example: Request for a non-existent webpage.
- Description: HTTP method is not allowed for the requested resource.
- Example: DELETE request to a read-only endpoint.
- Description: Content does not match client’s Accept headers.
- Example: Client requests XML, but only JSON is available.
- Description: Proxy authentication required.
- Example: Request through a corporate proxy without credentials.
- Description: Server timed out waiting for the request.
- Example: Slow internet connection causes a timeout.
- Description: Request conflicts with server state.
- Example: Concurrent updates to a document in a collaborative app.
- Description: Resource permanently removed.
- Example: Deprecated API endpoint.
- Description: Content-Length header is missing.
- Example: POST request without specifying content length.
- Description: Preconditions in headers not met.
- Example: Conditional update request fails due to modified data.
- Description: Payload exceeds server limits.
- Example: File upload exceeds max upload size.
- Description: URI is too long for the server to process.
- Example: Too many parameters in a GET request.
- Description: Unsupported content format.
- Example: Server receives an unsupported media type, such as
.exe
for an image upload.
- Description: Requested range not available.
- Example: Requesting a range beyond file length.
- Description: Expectation in headers cannot be met.
- Example: Server fails to meet
Expect: 100-continue
header.
- Description: April Fools' joke status code.
- Example: For fun, returned by a teapot API as a joke.
- Description: Request was directed to a server that cannot respond.
- Example: Server configuration issue causing requests to be misdirected.
- Description: Request is well-formed but has semantic errors.
- Example: Valid JSON payload with invalid data.
- Description: Resource is locked.
- Example: Editing a locked document returns
423 Locked
.
- Description: Failed due to dependency on another action.
- Example: Chained requests where one fails, causing others to fail.
- Description: Indicates request might be replayed.
- Example: When using
Early Data
in HTTP/2 connections.
- Description: Client should upgrade to a different protocol.
- Example: Server requires client to upgrade to HTTP/2.
- Description: Requires conditions to prevent conflicts.
- Example: PUT request that includes conditional headers.
- Description: Rate limit exceeded.
- Example: Frequent API calls triggering rate limits.
- Description: Headers too large for the server.
- Example: Long headers like cookies exceeding limits.
Reasons
- Description: Resource restricted for legal reasons.
- Example: Content blocked due to a court order.
- Description: General server error.
- Example: Server fails unexpectedly due to a misconfiguration.
- Description: Request method not supported.
- Example: Server doesn’t support PATCH requests.
- Description: Server received invalid response from upstream.
- Example: Proxy server cannot reach backend server.
- Description: Server is overloaded or under maintenance.
- Example: Site under maintenance returns
503
.
- Description: Gateway timed out waiting for a response.
- Example: Proxy fails due to slow backend.
- Description: HTTP version is not supported by the server.
- Example: Server rejects requests using outdated HTTP versions.
- Description: Circular content negotiation detected.
- Example: Negotiation logic loop.
- Description: Not enough storage for request.
- Example: Server unable to upload file due to storage limits.
- Description: Infinite loop detected during processing.
- Example: Server detects recursion in resource.
- Description: Further extensions required.
- Example: Client needs to extend request with additional requirements.
- Description: Client must authenticate to access the network.
- Example: Hotel Wi-Fi redirecting to login page.
Each status code is essential for efficient HTTP communication. By understanding these codes, developers can better handle responses and errors, enhancing application robustness and reliability.