广告

🌐 HTTP 状态代码参考

HTTP 响应状态代码的完整参考及其含义和 例子。

1xx - Informational Responses
Code Name Description
100 Continue The server has received the request headers; client should proceed to send the request body.
101 Switching Protocols The server is switching protocols as requested (e.g., upgrading to WebSocket).
102 Processing The server is processing the request but no response is available yet (WebDAV).
103 Early Hints Used to return some response headers before the final response.
2xx - Success
Code Name Description
200 OK 通用 The request succeeded. The standard response for successful HTTP requests.
201 Created 通用 The request succeeded and a new resource was created (typically for POST/PUT).
202 Accepted The request has been accepted for processing but not yet completed (async operations).
204 No Content 通用 The request succeeded but there's no content to return (often used for DELETE).
206 Partial Content The server is delivering only part of the resource (used for range requests like video streaming).
3xx - Redirection
Code Name Description
301 Moved Permanently 通用 The resource has been permanently moved to a new URL. Search engines update their links.
302 Found (Temp Redirect) The resource temporarily resides at a different URL.
303 See Other The response can be found at a different URL using GET method.
304 Not Modified 通用 The resource hasn't changed since last request. Used for caching.
307 Temporary Redirect Like 302, but the request method must not change (e.g., POST stays POST).
308 Permanent Redirect Like 301, but the request method must not change.
4xx - Client Errors
Code Name Description
400 Bad Request 通用 The server cannot process the request due to invalid syntax or malformed data.
401 Unauthorized 通用 Authentication is required. The user must log in to access this resource.
403 Forbidden 通用 The server refuses to authorize the request. Unlike 401, logging in won't help.
404 Not Found 通用 The requested resource could not be found on the server.
405 Method Not Allowed The HTTP method (GET, POST, etc.) is not supported for this resource.
408 Request Timeout The server timed out waiting for the request.
409 Conflict The request conflicts with the current state of the server (e.g., duplicate entry).
413 Payload Too Large The request body exceeds the server's size limit.
422 Unprocessable Entity The request was well-formed but has semantic errors (validation failures).
429 Too Many Requests 通用 Rate limiting - the user has sent too many requests in a given time.
5xx - Server Errors
Code Name Description
500 Internal Server Error 通用 A generic error when the server encounters an unexpected condition.
501 Not Implemented The server does not support the functionality required to fulfill the request.
502 Bad Gateway 通用 The server received an invalid response from an upstream server.
503 Service Unavailable 通用 The server is temporarily unavailable (overloaded or down for maintenance).
504 Gateway Timeout The server didn't receive a timely response from an upstream server.
507 Insufficient Storage The server cannot store the representation needed to complete the request.