HTTP 状态码查询 使用教程
详细使用指南、最佳实践与常见问题解答
使用场景
HTTP 状态码查询工具适用于前后端开发、API 调试、运维排障、HTTP 学习等场景。当你在浏览器 DevTools 看到陌生的状态码,或在 curl 输出中需要确认含义时,这个工具能快速给出中英双语解释。
Use Cases
The HTTP Status Code Lookup is useful for frontend/backend development, API debugging, ops troubleshooting, and HTTP learning. When you see an unfamiliar status code in DevTools or curl output, this tool gives you bilingual explanations instantly.
功能特点
- 覆盖全面:1xx/2xx/3xx/4xx/5xx 五大类共 60+ 条标准与扩展状态码
- 即时搜索:支持按状态码、名称、描述关键词搜索
- 分类筛选:一键筛选 1xx-5xx 任一类别
- 中英双语:每条状态码含中英文说明,方便对照学习
- 一键复制:点击卡片即可复制状态码到剪贴板
Features
- Comprehensive: 60+ standard and extended codes across 1xx/2xx/3xx/4xx/5xx
- Instant search: filter by code, name, or description keyword
- Category filter: one-click filter by 1xx-5xx
- Bilingual: each entry has both Chinese and English explanations
- One-click copy: click any card to copy the code to clipboard
使用示例
示例 1:场景一:前端拿到 401,搜索"401"快速确认是未授权,需要引导用户重新登录。
示例 2:场景二:运维看到 502/504,搜索确认是网关问题(上游故障或超时),决定重启服务还是联系上游。
示例 3:场景三:学习 HTTP 时,点击"4xx"筛选,浏览所有客户端错误码,理解 401/403/404 的差异。
Examples
Example 1: Scenario 1: Frontend gets a 401; search "401" to confirm it means Unauthorized, prompting a re-login.
Example 2: Scenario 2: Ops sees a 502/504; search to confirm gateway issue (upstream failure or timeout), deciding whether to restart the service or contact upstream.
Example 3: Scenario 3: When learning HTTP, click "4xx" to browse all client errors and understand the difference between 401/403/404.
最佳实践
- 记住常见码:200(成功)、301(永久重定向)、304(未修改)、404(未找到)、500(服务器错误)、503(服务不可用)
- 区分 401 与 403:401 是未认证(需登录),403 是已认证但无权限
- 区分 301 与 302:301 永久迁移(SEO 权重转移),302 临时跳转(权重不转移)
- 4xx 是客户端问题(检查参数/认证),5xx 是服务端问题(联系后端)
Best Practices
- Memorize common codes: 200 (OK), 301 (Moved Permanently), 304 (Not Modified), 404 (Not Found), 500 (Internal Server Error), 503 (Service Unavailable)
- Distinguish 401 vs 403: 401 means unauthenticated (need login), 403 means authenticated but no permission
- Distinguish 301 vs 302: 301 is permanent (SEO juice transferred), 302 is temporary (no transfer)
- 4xx is client-side (check params/auth), 5xx is server-side (contact backend)
常见问题
为什么有些状态码我没见过?
本工具包含 RFC 9110 标准状态码以及 WebDAV、HTTP/2 等扩展状态码(如 207、421、425),实际项目中使用频率较低但完整收录。
418 我是个茶壶是什么?
RFC 2324(HTCPCP)定义的愚人节玩笑状态码,实际不会被使用,但已成为程序员文化梗。
如何记忆 1xx-5xx 的分类?
1 信息、2 成功、3 重定向、4 客户端错误、5 服务器错误。
FAQ
Why are some codes unfamiliar to me?
This tool includes standard RFC 9110 codes plus WebDAV, HTTP/2, etc. extensions (e.g., 207, 421, 425), which are rare in real projects but included for completeness.
What is 418 I'm a Teapot?
An April Fools status code defined in RFC 2324 (HTCPCP), never actually used but a programmer culture meme.
How to memorize 1xx-5xx categories?
1 Informational, 2 Success, 3 Redirection, 4 Client Error, 5 Server Error.