HTTP 状态码大全(JSON)
从 100 Continue 到 511,完整的 HTTP 状态码、标准原因短语与所属类别,可筛选、复制、下载为 JSON。
| 代码 | 名称 | 类别 |
|---|---|---|
| 100 | Continue | informational |
| 101 | Switching Protocols | informational |
| 102 | Processing | informational |
| 103 | Early Hints | informational |
| 200 | OK | success |
| 201 | Created | success |
| 202 | Accepted | success |
| 203 | Non-Authoritative Information | success |
| 204 | No Content | success |
| 205 | Reset Content | success |
| 206 | Partial Content | success |
| 207 | Multi-Status | success |
| 208 | Already Reported | success |
| 226 | IM Used | success |
| 300 | Multiple Choices | redirect |
| 301 | Moved Permanently | redirect |
| 302 | Found | redirect |
| 303 | See Other | redirect |
| 304 | Not Modified | redirect |
| 307 | Temporary Redirect | redirect |
| 308 | Permanent Redirect | redirect |
| 400 | Bad Request | client |
| 401 | Unauthorized | client |
| 402 | Payment Required | client |
| 403 | Forbidden | client |
| 404 | Not Found | client |
| 405 | Method Not Allowed | client |
| 406 | Not Acceptable | client |
| 407 | Proxy Authentication Required | client |
| 408 | Request Timeout | client |
| 409 | Conflict | client |
| 410 | Gone | client |
| 411 | Length Required | client |
| 412 | Precondition Failed | client |
| 413 | Content Too Large | client |
| 414 | URI Too Long | client |
| 415 | Unsupported Media Type | client |
| 416 | Range Not Satisfiable | client |
| 417 | Expectation Failed | client |
| 418 | I'm a teapot | client |
| 421 | Misdirected Request | client |
| 422 | Unprocessable Content | client |
| 423 | Locked | client |
| 424 | Failed Dependency | client |
| 425 | Too Early | client |
| 426 | Upgrade Required | client |
| 428 | Precondition Required | client |
| 429 | Too Many Requests | client |
| 431 | Request Header Fields Too Large | client |
| 451 | Unavailable For Legal Reasons | client |
| 500 | Internal Server Error | server |
| 501 | Not Implemented | server |
| 502 | Bad Gateway | server |
| 503 | Service Unavailable | server |
| 504 | Gateway Timeout | server |
| 505 | HTTP Version Not Supported | server |
| 506 | Variant Also Negotiates | server |
| 507 | Insufficient Storage | server |
| 508 | Loop Detected | server |
| 510 | Not Extended | server |
| 511 | Network Authentication Required | server |
依据 RFC 9110 及 WebDAV 等常见扩展整理;304 属重定向类,418 为保留的玩笑状态码。
状态码怎么分类
1xx 是信息性响应,2xx 表示成功,3xx 是重定向,4xx 是客户端错误,5xx 是服务端错误。排查接口问题先看首位数字就能定位大方向:401 与 403 是权限问题,404 是资源不存在,429 是被限流,502 / 504 多半是网关背后的服务挂了或超时。
开发里怎么用这份表
把 JSON 复制进项目当常量映射,给日志与监控面板把数字翻译成人话;写接口时对照标准短语选语义最贴切的码,不要一律 200 加业务码,也不要把参数错误返回成 500。