REF-003 • Web Reference Web

HTTP Status Codes

Understand HTTP response codes from successful requests and redirects to client errors, server failures, and rate limits.

Published
Responses Redirects Errors HTTP
3 Digits Response Code
5 Classes 1xx Through 5xx
100–599 Valid Code Range
Quick Answer

HTTP status codes are three-digit server responses grouped into five classes. 1xx means informational, 2xx means success, 3xx means redirection, 4xx indicates a client-side request problem, and 5xx indicates that the server failed to fulfill an apparently valid request.

Response Classes

HTTP Status Code Classes

The first digit of an HTTP status code identifies its response class. The remaining two digits identify the specific response within that class.

Informational Request In Progress

Interim responses sent before the final response is available.

Successful Request Succeeded

The request was successfully received, understood, and accepted.

Redirection Further Action

Additional action may be required to complete the request.

Client Error Request Problem

The request appears to contain an error or cannot be fulfilled.

Server Error Server Failure

The server failed to fulfill an apparently valid request.

Unknown Status Codes

HTTP status codes are extensible. A client that does not recognize a specific code can still use the first digit to determine its general response class.

Quick Lookup

Common HTTP Status Codes

These are some of the HTTP response codes most commonly encountered when browsing, developing, debugging, operating websites, or working with APIs.

Code Name Class Meaning
100 Continue Informational The initial request was received; the client can continue sending it.
101 Switching Protocols Informational The server agrees to switch protocols as requested.
103 Early Hints Informational Sends preliminary response headers before the final response.
200 OK Successful The request succeeded.
201 Created Successful The request succeeded and created one or more new resources.
202 Accepted Successful The request was accepted for processing but is not yet complete.
204 No Content Successful The request succeeded and no response content is being returned.
206 Partial Content Successful The server is returning only the requested byte range.
301 Moved Permanently Redirection The resource has been assigned a new permanent URI.
302 Found Redirection The resource is temporarily available at another URI.
303 See Other Redirection Retrieve a different resource, normally using GET or HEAD.
304 Not Modified Redirection A cached representation can continue to be used.
307 Temporary Redirect Redirection Temporary redirect that preserves the original request method.
308 Permanent Redirect Redirection Permanent redirect that preserves the original request method.
400 Bad Request Client Error The server cannot or will not process the malformed or invalid request.
401 Unauthorized Client Error Valid authentication credentials are required.
403 Forbidden Client Error The server understood the request but refuses to fulfill it.
404 Not Found Client Error The requested resource could not be found.
405 Method Not Allowed Client Error The HTTP method is recognized but not supported for this resource.
408 Request Timeout Client Error The server did not receive a complete request in time.
409 Conflict Client Error The request conflicts with the current state of the resource.
410 Gone Client Error The resource is no longer available and is intended to be gone.
422 Unprocessable Content Client Error The syntax is understood but the contained instructions cannot be processed.
429 Too Many Requests Client Error The client has exceeded a request rate limit.
500 Internal Server Error Server Error An unexpected server condition prevented completion.
501 Not Implemented Server Error The server does not support the required functionality.
502 Bad Gateway Server Error A gateway or proxy received an invalid upstream response.
503 Service Unavailable Server Error The server is temporarily unable to handle the request.
504 Gateway Timeout Server Error A gateway did not receive a timely upstream response.
Reason Phrases

Names such as OK, Not Found, and Internal Server Error help humans identify a response, but the numeric status code carries the protocol meaning.

2xx Responses

Success Codes Explained

A 2xx response means the request was successfully received, understood, and accepted. The exact status code describes what kind of success occurred.

200 OK

General successful response. Common for normal page requests, API reads, and successful actions.

201 Created

The request succeeded and resulted in one or more new resources being created.

202 Accepted

The request has been accepted for processing, but processing has not necessarily finished.

204 No Content

The action succeeded and the server does not need to return response content.

206 Partial Content

The response contains only part of a representation requested using a range.

200 vs 204

Use 200 OK when the successful response includes the expected representation or result. A 204 No Content response communicates success without response content.

3xx Responses

HTTP Redirect Codes

Several 3xx responses direct a client toward another URI, but they are not interchangeable. The most important differences are whether the move is temporary or permanent and whether the original request method must be preserved.

Code Type Duration Request Method Typical Use
301 Moved Permanently Permanent May change POST to GET in common user-agent behavior Permanent URL change
302 Found Temporary May change POST to GET in common user-agent behavior Temporary destination
303 See Other Indirect response Retrieve target using GET or HEAD Redirect after an action
307 Temporary Redirect Temporary Preserved Temporary redirect where method must remain unchanged
308 Permanent Redirect Permanent Preserved Permanent redirect where method must remain unchanged
301 Is Not the Same as 308

Both indicate a permanent move, but 308 Permanent Redirect requires the client to preserve the original request method. With 301, historical browser behavior allows a POST request to be redirected as a GET.

304 Is Different

304 Not Modified is in the 3xx class but is not a normal destination redirect. It tells the client that a previously cached representation can still be used.

4xx Responses

Client Error Codes

A 4xx response means the server considers the request itself to be the problem or cannot fulfill it under the current conditions. The specific code identifies what needs attention.

400 Bad Request

The request is malformed, invalid, or otherwise cannot be processed.

401 Unauthorized

Authentication is required and the supplied credentials are missing or invalid.

403 Forbidden

The request was understood, but the server refuses to fulfill it.

404 Not Found

No current resource was found at the requested URI, or the server does not wish to disclose one.

410 Gone

The resource is intentionally no longer available and the condition is expected to be permanent.

429 Too Many Requests

Too many requests were sent within a period of time and the client has been rate limited.

401 vs 403 vs 404

Code Main Question Meaning
401 Are you authenticated? Valid authentication credentials are required.
403 Are you allowed? The server knows what was requested but refuses to authorize it.
404 Is the resource available here? The requested resource was not found or its existence is not being disclosed.
Rate Limiting

A 429 Too Many Requests response can include a Retry-After header indicating how long the client should wait before trying again.

5xx Responses

Server Error Codes

A 5xx response indicates that the server failed to fulfill an apparently valid request. The problem may be inside the application, at a gateway, or on an upstream server.

500 Internal Server Error

A generic unexpected server condition prevented the request from completing.

501 Not Implemented

The server does not support the functionality required to fulfill the request.

502 Bad Gateway

A gateway or proxy received an invalid response from an upstream server.

503 Service Unavailable

The server is temporarily unable to handle the request, often because of overload or maintenance.

504 Gateway Timeout

A gateway or proxy did not receive a timely response from an upstream server.

502 vs 504

A 502 Bad Gateway generally means the gateway received an invalid upstream response. A 504 Gateway Timeout means the gateway did not receive that upstream response in time.

Temporary Failures

A 503 Service Unavailable response is generally intended for a temporary condition. The server can include a Retry-After header to indicate when the client may retry.

Practical Guide

Reading HTTP Errors

The status code identifies where to begin, but it rarely explains the entire cause. Use the code together with the request, response headers, application logs, proxy logs, and server configuration.

Code First Things to Check Common Area
400 Request syntax, headers, parameters, payload Client / application
401 Credentials, token, authentication header Authentication
403 Permissions, access rules, authorization Authorization
404 URL, route, filename, rewrite or deployment Routing / resource
429 Rate limits, request frequency, retry policy API / traffic control
500 Application logs, exceptions, configuration Origin server
502 Reverse proxy, upstream service, invalid upstream response Gateway / upstream
503 Server load, maintenance, unavailable dependencies Availability
504 Upstream response time, gateway timeout settings Gateway / upstream
Browser Message vs HTTP Code

Not every browser network error is an HTTP status code. DNS failures, TLS errors, connection failures, and interrupted connections can occur before a valid HTTP response is received.

FAQ

HTTP Status Code Questions

What is an HTTP status code?

An HTTP status code is a three-digit number in a server response that describes the result of an HTTP request. Valid HTTP status codes fall between 100 and 599.

What does HTTP 200 mean?

200 OK means the request succeeded. The exact meaning of the returned content depends on the HTTP request method.

What is the difference between 301 and 302?

301 Moved Permanently indicates a permanent move to another URI. 302 Found indicates that the resource is temporarily available at another URI.

What is the difference between 301 and 308?

Both describe permanent redirects. A 308 Permanent Redirect requires the client to preserve the original request method. With a 301, user agents may change a POST request to GET when following the redirect.

What is the difference between 401 and 403?

401 Unauthorized means the request lacks valid authentication credentials. 403 Forbidden means the server understood the request but refuses to fulfill it.

What does HTTP 404 mean?

404 Not Found means the server did not find a current representation for the requested resource or is not willing to disclose that one exists.

What does HTTP 429 mean?

429 Too Many Requests means too many requests were sent within a period of time. It is commonly used for rate limiting and may include a Retry-After header.

What is the difference between 502 and 504?

502 Bad Gateway means a gateway or proxy received an invalid response from an upstream server. 504 Gateway Timeout means the upstream server did not respond within the required time.