HTTP 状态码
按类别浏览状态码。展开任意一行即可查看该状态码的真实 HTTP 报文示例。
1xx信息响应(Informational)
100Continue客户端应继续发送请求体。查看示例
→ REQUEST
POST /uploads HTTP/1.1 Host: example.com Content-Length: 5242880 Expect: 100-continue
← RESPONSE
HTTP/1.1 100 Continue (client now streams the 5 MB body) HTTP/1.1 201 Created Location: /uploads/8f2c
101Switching Protocols服务器同意切换协议(如升级到 WebSocket)。查看示例
→ REQUEST
GET /chat HTTP/1.1 Host: example.com Upgrade: websocket Connection: Upgrade Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ== Sec-WebSocket-Version: 13
← RESPONSE
HTTP/1.1 101 Switching Protocols Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=
102ProcessingUnderstand the 102 Processing status code, how the response prevents client timeouts during long-running requests, and its WebDAV origins.查看示例
→ REQUEST
GET /sample.pdf HTTP/1.1 Host: example.com
103Early HintsUnderstand 103 Early Hints and how the status code speeds up page loads by preloading resources before the final response arrives.查看示例
→ REQUEST
GET /index.html HTTP/1.1 Host: example.com
2xx成功(Success)
200OK请求成功,响应含所请求的资源。查看示例
→ REQUEST
GET /products/42 HTTP/1.1 Host: example.com
← RESPONSE
HTTP/1.1 200 OK Content-Type: application/json Content-Length: 51 { "id": 42, "name": "Trailhead Boot", "price": 189 }
201Created请求成功且创建了新资源。查看示例
→ REQUEST
POST /products HTTP/1.1 Host: example.com Content-Type: application/json { "name": "Ridge Boot", "price": 210 }
← RESPONSE
HTTP/1.1 201 Created Location: /products/43 Content-Type: application/json { "id": 43, "name": "Ridge Boot", "price": 210 }
202AcceptedLearn what a 202 Accepted response means, how the status code signals asynchronous processing, and how to poll for the eventual result.查看示例
→ REQUEST
POST /job HTTP/1.1 Host: example.com Content-Type: application/xml Content-Length: 68 <?xml version="1.0"?> <job> <id>125</id> <task>G01</task> </job>
203Non-Authoritative InformationLearn what a 203 Non-Authoritative Information response means, when proxies return 203, and how the status code differs from 200 OK.查看示例
→ REQUEST
GET /instructions HTTP/1.1 Host: example.com
204No Content成功但无响应体。查看示例
→ REQUEST
DELETE /products/43 HTTP/1.1 Host: example.com
← RESPONSE
HTTP/1.1 204 No Content (no body)
205Reset ContentLearn what a 205 Reset Content response means, how the status code instructs clients to clear form data, and how 205 differs from 204.查看示例
→ REQUEST
POST /signup HTTP/1.1 Host: example.com Content-Type: application/xml Content-Length: 92 <?xml version="1.0"?> <person> <name>David Smith</name> <country>USA</country> </person>
206Partial ContentUnderstand the 206 Partial Content response, how Range requests work for resumable downloads, and multipart range responses.查看示例
→ REQUEST
GET /videos/sample.mp4 HTTP/1.1 Host: example.com Range: bytes=25000-75000
207Multi-StatusLearn what a 207 Multi-Status response means, how WebDAV uses 207 to report per-resource results, and how to parse the XML body.查看示例
<d:response> <d:href>http://example.re/tasks</d:href> <d:status>HTTP/1.1 200 OK</d:status> </d:response>
208Already ReportedUnderstand the 208 Already Reported status code, how WebDAV uses 208 inside 207 responses to avoid duplicate resource listings.查看示例
→ REQUEST
PROPFIND /main/ HTTP/1.1 Host: example.com Depth: infinity DAV: bind Content-Type: application/xml; charset="utf-8" Content-Length: 139 <?xml version="1.0" encoding="utf-8" ?> <d:propfind xmlns:d="DAV:"> <d:prop> <d:name/> <d:link/> </d:prop> </d:propfind>
226IM UsedLearn what a 226 IM Used response means, how delta encoding and instance manipulations conserve bandwidth in HTTP responses.查看示例
→ REQUEST
GET /livingdocs/current_specs.pdf HTTP/1.1 Host: example.com Accept-Encoding: gzip
3xx重定向(Redirection)
300Multiple ChoicesUnderstand the 300 Multiple Choices response, when servers send 300, and how clients select from multiple available representations.查看示例
→ REQUEST
GET /tech-news HTTP/1.1 Host: example.com
301Moved Permanently资源已永久移动到 Location 指向的地址。查看示例
→ REQUEST
GET /old-path HTTP/1.1 Host: example.com
← RESPONSE
HTTP/1.1 301 Moved Permanently Location: https://example.com/new-path
302Found资源临时位于 Location。查看示例
→ REQUEST
GET /account HTTP/1.1 Host: example.com
← RESPONSE
HTTP/1.1 302 Found Location: /login
303See OtherLearn how the 303 See Other redirect works, why 303 always switches to GET, and when to use 303 after POST, PUT, or DELETE requests.查看示例
→ REQUEST
DELETE /tasks/314 HTTP/1.1 Host: example.com
304Not Modified缓存有效,可直接使用本地副本。查看示例
→ REQUEST
GET /logo.png HTTP/1.1 Host: example.com If-None-Match: "9c2e-abc123"
← RESPONSE
HTTP/1.1 304 Not Modified ETag: "9c2e-abc123" (no body — reuse the cached copy)
305Use ProxyLearn about the deprecated 305 Use Proxy status code, why 305 was removed over security concerns, and what replaced the status code.查看示例
→ REQUEST
GET /document.pdf HTTP/1.1 Host: example.com
307Temporary RedirectUnderstand the 307 Temporary Redirect, why 307 preserves the request method unlike 302, and when to use 307 over 302 or 303.查看示例
→ REQUEST
GET /news.html HTTP/1.1 Host: example.com
308Permanent RedirectUnderstand the 308 Permanent Redirect, how 308 preserves the request method unlike 301, and how search engines transfer link equity.查看示例
→ REQUEST
POST /api/v1/orders HTTP/1.1 Host: example.com Content-Type: application/json Content-Length: 35 {"item": "widget", "quantity": 10}
4xx客户端错误(Client Error)
400Bad Request请求语法或参数有误。查看示例
→ REQUEST
POST /products HTTP/1.1 Host: example.com Content-Type: application/json { "price": "not-a-number" }
← RESPONSE
HTTP/1.1 400 Bad Request Content-Type: application/json { "error": "price must be a number" }
401Unauthorized需要身份认证。查看示例
→ REQUEST
GET /account HTTP/1.1 Host: example.com
← RESPONSE
HTTP/1.1 401 Unauthorized WWW-Authenticate: Bearer realm="api"
402Payment RequiredUnderstand 402 Payment Required: a reserved status code, its non-standard usage by Shopify and Stripe, and SEO impact.查看示例
→ REQUEST
GET /tech-news HTTP/1.1 Host: example.com
403Forbidden已认证但无权限。查看示例
→ REQUEST
DELETE /users/1 HTTP/1.1 Host: example.com Authorization: Bearer <valid-token>
← RESPONSE
HTTP/1.1 403 Forbidden Content-Type: application/json { "error": "admin role required" }
404Not Found找不到目标资源。查看示例
→ REQUEST
GET /products/9999 HTTP/1.1 Host: example.com
← RESPONSE
HTTP/1.1 404 Not Found Content-Type: application/json { "error": "product 9999 not found" }
405Method Not Allowed该资源不支持所用方法。查看示例
→ REQUEST
DELETE /products HTTP/1.1 Host: example.com
← RESPONSE
HTTP/1.1 405 Method Not Allowed Allow: GET, POST, QUERY
406Not AcceptableFix 406 Not Acceptable errors. Understand content negotiation, Accept headers, and how servers handle unsatisfiable requests.查看示例
Accept: text/html, text/plain
407Proxy Authentication RequiredFix 407 Proxy Authentication Required errors. Learn proxy authentication schemes and Proxy-Authenticate headers.查看示例
→ REQUEST
GET /documents/tech-news HTTP/1.1 Host: example.com
408Request TimeoutFix 408 Request Timeout errors. Understand why servers close slow connections and how to resolve transmission issues.查看示例
→ REQUEST
PUT /docs HTTP/1.1 Host: example.com Content-Type: application/pdf Content-Length: 10000
409ConflictFix 409 Conflict errors. Understand resource state conflicts, resolution strategies, and common API use cases.查看示例
→ REQUEST
POST /blog/update?postid=111&flag=like HTTP/1.1 Host: example.com
410GoneUnderstand 410 Gone: permanent resource removal, differences from 404, caching behavior, and SEO indexing impact.查看示例
→ REQUEST
GET /holiday-promotion-Jan-2021.pdf HTTP/1.1 Host: example.com
411Length RequiredFix 411 Length Required errors. Learn when the Content-Length header is needed and how to resolve this client error.查看示例
→ REQUEST
PUT /docs HTTP/1.1 Host: example.com Content-Type: application/pdf <PDF file included as message body>
412Precondition FailedFix 412 Precondition Failed errors. Learn conditional request headers, If-Match failures, and lost update prevention.查看示例
→ REQUEST
POST /blog/update?postid=111&task=reply HTTP/1.1 Host: example.com If-Unmodified-Since: Fri, 1 Jan 2021 00:00:00 GMT Content-Type: text/plain Content-Length: 45 <Message body contains reply-text from the client>
413Content Too LargeFix 413 Content Too Large errors. Learn server size limits, Expect header usage, and how to handle oversized uploads.查看示例
→ REQUEST
PUT /docs HTTP/1.1 Host: example.com Content-Type: application/pdf Content-Length: 10000
414URI Too LongFix 414 URI Too Long errors. Understand URL length limits, browser restrictions, and how to shorten request URIs.查看示例
→ REQUEST
GET /<...a_long_URI...> HTTP/1.1 Host: example.com
415Unsupported Media TypeFix 415 Unsupported Media Type errors. Learn Content-Type and Content-Encoding validation, with troubleshooting steps.查看示例
→ REQUEST
POST /blog/newmessage HTTP/1.1 Host: example.com Content-Type: text/plain Content-Length: 24 Good morning, Everybody!
416Range Not SatisfiableFix 416 Range Not Satisfiable errors. Understand byte range requests, the Content-Range header, and resolution.查看示例
Content-Range: bytes */512
417Expectation FailedFix 417 Expectation Failed errors. Learn how the Expect header and 100-continue mechanism work and when 417 is returned.查看示例
→ REQUEST
PUT /docs HTTP/1.1 Host: example.com Content-Type: application/pdf Content-Length: 10000 Expect: 100-continue
418I'm a teapot我是茶壶——RFC 2324 的彩蛋状态码。查看示例
→ REQUEST
BREW /coffee HTTP/1.1 Host: teapot.example
← RESPONSE
HTTP/1.1 418 I'm a teapot Content-Type: text/plain I refuse to brew coffee — I am a teapot.
421Misdirected RequestFix 421 Misdirected Request errors. Understand connection reuse, HTTP/2 routing, and Alt-Svc troubleshooting.查看示例
→ REQUEST
GET /tech-news HTTP/2 Host: example.com
422Unprocessable ContentFix 422 Unprocessable Content errors. Learn differences from 400 and 415, and how to resolve semantic validation failures.查看示例
→ REQUEST
POST /requests HTTP/1.1 Host: example.com Content-Type: application/xml Content-Length: 101 <?xml version="1.0" encoding="utf-8"?> <request> <id>100</id> <action>start</action> </request>
423LockedFix 423 Locked errors. Learn WebDAV file locking mechanisms, Lock-Token headers, precondition codes, and how to unlock resources.查看示例
→ REQUEST
PUT /documents/ HTTP/1.1 Host: example.com Content-Type: application/pdf Content-Length: 10000 <PDF file transferred>
424Failed DependencyFix 424 Failed Dependency errors. Learn WebDAV multi-status responses, PROPPATCH operations, and dependency resolution.查看示例
→ REQUEST
PROPPATCH /update.html HTTP/1.1 Host: example.com Content-Type: application/xml; charset="utf-8" Content-Length: 305 <?xml version="1.0" encoding="utf-8" ?> <d:propertyupdate xmlns:d="DAV:" xmlns:z="urn:example"> <d:set> <d:prop> <z:seats> <z:seatnumber>100</z:seatnumber> <z:seatnumber>101</z:seatnumber> </z:seats> </d:prop> <d:prop> <d:name>Smith</d:name> </d:prop> </d:set> </d:propertyupdate>
425Too EarlyUnderstand 425 Too Early: TLS early data replay risks, the Early-Data header, and server-side protection strategies.查看示例
→ REQUEST
GET /tech-news HTTP/1.1 Host: example.com Early-Data: 1
426Upgrade RequiredFix 426 Upgrade Required errors. Learn protocol upgrade requirements, the Upgrade header, and resolution steps.查看示例
→ REQUEST
GET /tech-news HTTP/1.1 Host: example.com
428Precondition RequiredFix 428 Precondition Required errors. Learn conditional headers like If-Match and how to prevent lost updates.查看示例
→ REQUEST
PUT /reservations.txt HTTP/1.1 Host: example.com
429Too Many Requests请求过于频繁,被限流。查看示例
→ REQUEST
GET /api/search HTTP/1.1 Host: example.com
← RESPONSE
HTTP/1.1 429 Too Many Requests Retry-After: 30 Content-Type: application/json { "error": "rate limit exceeded" }
431Request Header Fields Too LargeFix 431 Request Header Fields Too Large errors. Learn header size limits, cookie reduction, and troubleshooting steps.查看示例
→ REQUEST
GET /tech-news HTTP/1.1 Host: example.com Cookie: first_cookie=<very_long>; second_cookie=<long_again>
451Unavailable For Legal ReasonsUnderstand 451 Unavailable For Legal Reasons: censorship responses, legal demands, and Exchange ActiveSync usage.查看示例
→ REQUEST
GET /tech-trial-updates HTTP/1.1 Host: example.com
5xx服务器错误(Server Error)
500Internal Server Error服务器内部错误。查看示例
→ REQUEST
GET /report HTTP/1.1 Host: example.com
← RESPONSE
HTTP/1.1 500 Internal Server Error Content-Type: application/json { "error": "unexpected server error" }
501Not ImplementedFix 501 Not Implemented errors. Understand unsupported HTTP methods, differences from 405, and server configuration.查看示例
→ REQUEST
POST /requests?id=111&flag=start HTTP/1.1 Host: example.com
502Bad Gateway网关从上游收到无效响应。查看示例
→ REQUEST
GET /api/users HTTP/1.1 Host: gateway.example.com
← RESPONSE
HTTP/1.1 502 Bad Gateway Content-Type: text/plain upstream sent an invalid response
503Service Unavailable服务暂时不可用(过载或维护)。查看示例
→ REQUEST
GET / HTTP/1.1 Host: example.com
← RESPONSE
HTTP/1.1 503 Service Unavailable Retry-After: 120 Content-Type: text/plain under maintenance — try again shortly
504Gateway TimeoutFix 504 Gateway Timeout errors. Learn upstream timeout causes, proxy configuration, and troubleshooting.查看示例
→ REQUEST
GET /news HTTP/1.1 Host: example.com
505HTTP Version Not SupportedFix 505 HTTP Version Not Supported errors. Learn protocol version mismatches and server compatibility.查看示例
→ REQUEST
GET / HTTP/2 Host: example.com
506Variant Also NegotiatesUnderstand 506 Variant Also Negotiates: transparent content negotiation circular references and server misconfiguration.查看示例
→ REQUEST
GET /docs HTTP/1.1 Host: example.com Accept: text/html, application/xhtml+xml
507Insufficient StorageFix 507 Insufficient Storage errors. Understand WebDAV storage limits, differences from 413, and resolution.查看示例
→ REQUEST
PUT /docs HTTP/1.1 Host: example.com Content-Type: application/pdf Content-Length: 10000 <PDF file included in message body>
508Loop DetectedFix 508 Loop Detected errors. Understand WebDAV infinite loops and cPanel resource limit troubleshooting.查看示例
→ REQUEST
PROPFIND /shared/ HTTP/1.1 Host: example.com Depth: infinity Content-Type: application/xml
510Not ExtendedUnderstand 510 Not Extended: the obsolete HTTP Extension Framework, its historic status, and usage.查看示例
→ REQUEST
GET /resource HTTP/1.1 Host: example.com
511Network Authentication RequiredFix 511 Network Authentication Required errors. Understand captive portals, Wi-Fi login pages, and client handling.查看示例
→ REQUEST
GET / HTTP/1.1 Host: example.com