HTTP 状态码参考 | HTTP Status Code Reference

Quick reference for all standard HTTP response codes. Search by code number or name.

100
Continue1xx

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

Use case: Large file uploads, expect-continue

101
Switching Protocols1xx

The server is switching protocols as requested by the client via Upgrade header.

Use case: WebSocket upgrade, HTTP/2 upgrade

102
Processing1xx

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

Use case: WebDAV long-running operations

103
Early Hints1xx

Used to return some response headers before final HTTP message.

Use case: Preloading resources while server prepares response

200
OK2xx

The request has succeeded.

Use case: Standard successful GET/POST response

201
Created2xx

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

Use case: REST API POST creating a new resource

202
Accepted2xx

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

Use case: Async operations, batch processing

204
No Content2xx

The server has fulfilled the request but does not need to return an entity-body.

Use case: Successful DELETE, PUT without response body

206
Partial Content2xx

The server has fulfilled the partial GET request for the resource.

Use case: Range requests, video streaming, download resume

301
Moved Permanently3xx

The requested resource has been assigned a new permanent URI.

Use case: Domain migration, URL restructuring, HTTP to HTTPS

302
Found3xx

The requested resource resides temporarily under a different URI.

Use case: Temporary redirects, login redirects

304
Not Modified3xx

The resource has not been modified since the last request.

Use case: Browser cache validation, conditional GET

307
Temporary Redirect3xx

The requested resource resides temporarily under a different URI, preserving the request method.

Use case: Temporary redirect preserving POST method

308
Permanent Redirect3xx

The resource is now permanently located at a different URI, preserving the request method.

Use case: Permanent redirect preserving POST method

400
Bad Request4xx

The server could not understand the request due to malformed syntax.

Use case: Invalid JSON, missing required fields, bad query params

401
Unauthorized4xx

The request requires user authentication.

Use case: Missing or invalid API key, expired token

403
Forbidden4xx

The server understood the request but refuses to authorize it.

Use case: Insufficient permissions, IP blocked, rate limited

404
Not Found4xx

The server has not found anything matching the Request-URI.

Use case: Invalid URL, deleted resource, typo in endpoint

405
Method Not Allowed4xx

The method specified in the Request-Line is not allowed for the identified resource.

Use case: POST to a GET-only endpoint

408
Request Timeout4xx

The client did not produce a request within the time the server was prepared to wait.

Use case: Slow client connection, upload timeout

409
Conflict4xx

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

Use case: Duplicate entry, version conflict, concurrent edit

410
Gone4xx

The requested resource is no longer available and no forwarding address is known.

Use case: Permanently deleted resource

413
Payload Too Large4xx

The request entity is larger than limits defined by server.

Use case: File upload exceeding size limit

415
Unsupported Media Type4xx

The server refuses to accept the request because the payload format is unsupported.

Use case: Sending XML when API expects JSON

422
Unprocessable Entity4xx

The server understands the content type and syntax but was unable to process the contained instructions.

Use case: Validation errors in REST API

429
Too Many Requests4xx

The user has sent too many requests in a given amount of time.

Use case: Rate limiting, API throttling

500
Internal Server Error5xx

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

Use case: Unhandled exception, server crash

501
Not Implemented5xx

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

Use case: Unsupported HTTP method on endpoint

502
Bad Gateway5xx

The server received an invalid response from an upstream server.

Use case: Reverse proxy / load balancer, upstream server down

503
Service Unavailable5xx

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

Use case: Server maintenance, capacity overload

504
Gateway Timeout5xx

The server did not receive a timely response from an upstream server.

Use case: Upstream server timeout, slow API response

505
HTTP Version Not Supported5xx

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

Use case: HTTP/2 client talking to HTTP/1.1 only server

Showing 32 of 32 status codes.

🔧 你可能还需要