๐Ÿ“ก HTTP Status Codes

Complete reference of HTTP status codes with descriptions, use cases, and examples. Search and filter by category.

Showing 33 of 33 status codes
100

Continue

1xx

The server has received the request headers and the client should proceed to send the request body.

Use case: Used when the client needs to send a large request body.

101

Switching Protocols

1xx

The server is switching protocols as requested by the client.

Use case: Used when upgrading from HTTP to WebSocket.

102

Processing

1xx

The server has received and is processing the request, but no response is available yet.

Use case: Used for long-running requests to prevent timeout.

103

Early Hints

1xx

Used to return some response headers before final HTTP message.

Use case: Allows browser to preload resources while server prepares response.

200

OK

2xx

The request has succeeded.

Use case: Standard response for successful HTTP requests.

Example: GET /api/users

201

Created

2xx

The request has been fulfilled and a new resource has been created.

Use case: Returned after successfully creating a resource.

Example: POST /api/users

202

Accepted

2xx

The request has been accepted for processing, but processing has not been completed.

Use case: Used for asynchronous processing.

Example: POST /api/jobs

204

No Content

2xx

The server successfully processed the request but is not returning any content.

Use case: Used for successful DELETE requests or updates that don't return data.

Example: DELETE /api/users/123

206

Partial Content

2xx

The server is delivering only part of the resource due to a range header sent by the client.

Use case: Used for partial content requests (e.g., video streaming).

Example: GET /api/video with Range header

301

Moved Permanently

3xx

The requested resource has been permanently moved to a new URL.

Use case: Use when a resource has permanently moved to a new location.

Example: Old URL redirects to new URL

302

Found

3xx

The requested resource has been temporarily moved to a different URL.

Use case: Temporary redirect, commonly used for login redirects.

Example: Redirect after login

304

Not Modified

3xx

The resource has not been modified since the last request.

Use case: Used with conditional GET requests to save bandwidth.

Example: GET with If-Modified-Since header

307

Temporary Redirect

3xx

The request should be repeated with another URL, but the method must not be changed.

Use case: Similar to 302 but preserves HTTP method.

Example: POST redirect preserving method

308

Permanent Redirect

3xx

The request and all future requests should be repeated using another URL.

Use case: Similar to 301 but preserves HTTP method.

Example: Permanent redirect preserving method

400

Bad Request

4xx

The server cannot process the request due to a client error (e.g., malformed syntax).

Use case: Return when request syntax is invalid or missing required parameters.

Example: Invalid JSON in request body

401

Unauthorized

4xx

Authentication is required and has failed or has not been provided.

Use case: Return when authentication is required or has failed.

Example: Missing or invalid API token

403

Forbidden

4xx

The server understood the request but refuses to authorize it.

Use case: Return when user is authenticated but lacks permission.

Example: User tries to access admin resource

404

Not Found

4xx

The requested resource could not be found on the server.

Use case: Return when the requested resource does not exist.

Example: GET /api/users/999 (user doesn't exist)

405

Method Not Allowed

4xx

The request method is not allowed for the requested resource.

Use case: Return when HTTP method is not supported for the endpoint.

Example: POST to GET-only endpoint

406

Not Acceptable

4xx

The server cannot produce a response matching the list of acceptable values.

Use case: Return when server cannot satisfy Accept header requirements.

Example: Client requests XML but server only has JSON

409

Conflict

4xx

The request could not be completed due to a conflict with the current state of the resource.

Use case: Return when there is a conflict (e.g., duplicate email).

Example: Creating user with existing email

410

Gone

4xx

The requested resource is no longer available and will not be available again.

Use case: Return when resource existed but is permanently removed.

Example: Deleted resource that won't be restored

413

Payload Too Large

4xx

The request entity is larger than limits defined by the server.

Use case: Return when request body exceeds size limit.

Example: File upload exceeds 10MB limit

414

URI Too Long

4xx

The URI provided was too long for the server to process.

Use case: Return when URL exceeds maximum length.

Example: GET request with extremely long query string

415

Unsupported Media Type

4xx

The media format of the requested data is not supported by the server.

Use case: Return when Content-Type is not supported.

Example: Sending XML when server expects JSON

422

Unprocessable Entity

4xx

The request was well-formed but contains semantic errors.

Use case: Return when validation fails (e.g., invalid email format).

Example: POST with invalid email address

429

Too Many Requests

4xx

The user has sent too many requests in a given amount of time (rate limiting).

Use case: Return when rate limit is exceeded.

Example: More than 100 requests per minute

500

Internal Server Error

5xx

The server encountered an unexpected condition that prevented it from fulfilling the request.

Use case: Return for unexpected server errors.

Example: Unhandled exception in server code

501

Not Implemented

5xx

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

Use case: Return when server doesn't support the requested feature.

Example: Server doesn't support requested HTTP method

502

Bad Gateway

5xx

The server, while acting as a gateway or proxy, received an invalid response from an upstream server.

Use case: Return when gateway/proxy receives invalid response.

Example: API gateway receives error from backend

503

Service Unavailable

5xx

The server is currently unable to handle the request due to temporary overload or maintenance.

Use case: Return when service is temporarily unavailable.

Example: Server is down for maintenance

504

Gateway Timeout

5xx

The server, while acting as a gateway or proxy, did not receive a timely response from an upstream server.

Use case: Return when upstream server times out.

Example: Database query exceeds timeout

505

HTTP Version Not Supported

5xx

The server does not support the HTTP protocol version used in the request.

Use case: Return when HTTP version is not supported.

Example: Client uses HTTP/3 but server only supports HTTP/1.1

About HTTP Status Codes

HTTP status codes are three-digit numbers returned by a server to indicate the result of a request. They are grouped into five categories:

  • 1xx Informational: Request received, continuing process
  • 2xx Success: Request successfully received, understood, and accepted
  • 3xx Redirection: Further action needs to be taken to complete the request
  • 4xx Client Error: Request contains bad syntax or cannot be fulfilled
  • 5xx Server Error: Server failed to fulfill a valid request