所有工具

HTTP 状态码

常见 HTTP 响应码的可搜索参考。

1xx 信息性

100

Continue

服务器已收到请求标头,客户端可继续发送正文。用于在服务器可能拒绝请求时避免发送大载荷。

101

Switching Protocols

服务器同意按 Upgrade 标头要求切换协议(例如从 HTTP 到 WebSocket)。

102

Processing

服务器已收到并正在处理请求,但尚无响应正文。用于长时间运行的操作。

2xx 成功

200

OK

请求成功。响应正文通常包含请求的资源或操作结果。

201

Created

请求成功并创建了新资源。常见于 POST 后返回指向新资源的 Location 标头。

202

Accepted

请求已接受处理但尚未完成。常见于异步任务和后台作业。

204

No Content

请求成功但无内容返回。常见于正文为空的成功 DELETE 或 PUT。

3xx 重定向

301

Moved Permanently

资源已永久移至新 URL。客户端和搜索引擎应更新书签和链接。

302

Found

资源暂时可通过其他 URL 访问。后续请求仍可使用原 URL。

303

See Other

POST 之后,客户端应通过 GET 访问 Location 头中给出的 URL 获取结果。

304

Not Modified

缓存版本仍然有效。服务器不返回正文;客户端应使用本地缓存。

307

Temporary Redirect

保留原始 HTTP 方法的临时重定向。与旧版 302 处理不同,重定向后 POST 仍为 POST。

308

Permanent Redirect

保留原始 HTTP 方法的永久重定向。客户端应在后续请求中使用新 URL。

4xx 客户端错误

400

Bad Request

由于语法无效、缺少字段或 JSON 格式错误,服务器无法处理请求。请修正后重试。

401

Unauthorized

需要身份验证或验证失败。客户端应提供有效凭据,通常通过 Authorization 头或登录。

403

Forbidden

服务器理解请求但拒绝授权。用户可能已认证但缺少权限。

404

Not Found

请求的 URL 或资源不存在。请检查路径、路由或 ID — 或该项可能已被删除。

405

Method Not Allowed

此端点不允许该 HTTP 方法。例如,在仅支持 GET 时发送 POST。

408

Request Timeout

服务器等待完整请求超时。通常由慢速上传或空闲连接引起。

409

Conflict

请求与资源当前状态冲突。常见于创建重复项或违反版本约束。

410

Gone

资源曾存在但已被永久删除,不会再可用。对已删除内容比 404 更明确。

413

Payload Too Large

请求正文大于服务器愿意处理的大小。请减小载荷或使用分块上传。

414

URI Too Long

请求 URL 超出服务器限制。请缩短查询字符串或将数据移至请求正文。

415

Unsupported Media Type

服务器不支持请求的 Content-Type。请发送 JSON、表单数据或 API 接受的其他格式。

418

I'm a teapot

RFC 2324 中作为愚人节玩笑定义:服务器拒绝煮咖啡,因为它是茶壶。有时用于演示。

422

Unprocessable Entity

请求语法有效但语义不正确。常见于 REST API 和 Web 表单的验证错误。

429

Too Many Requests

客户端在给定时间窗口内发送了过多请求。请遵守 Retry-After 并实现退避或速率限制。

5xx 服务器错误

500

Internal Server Error

服务器发生意外错误。通常不是客户端的问题 — 请检查服务器日志并稍后重试。

501

Not Implemented

服务器不支持完成请求所需的功能。方法或特性未实现。

502

Bad Gateway

网关或代理收到来自上游服务器的无效响应。后端故障时常见于负载均衡器之后。

503

Service Unavailable

服务器暂时不可用,通常由于维护或过载。请稍后重试;如有 Retry-After 请查看。

504

Gateway Timeout

网关或代理未能及时收到上游服务器的响应。通常表示后端缓慢或存在网络问题。

32 个常见 HTTP 状态码

关于此工具

Browse HTTP status codes with this practical reference for API development and debugging. The HTTP status reference explains response classes and common edge cases from informational to server error codes.

Engineers use it to align backend behavior, frontend handling, and monitoring alerts around consistent semantics. Clear status code usage improves observability and client integration reliability.

常见问题

Why use an HTTP status reference during development?
It helps choose correct response codes for each outcome so clients can handle success and failure conditions predictably.
What is the difference between 4xx and 5xx?
4xx indicates client-side request issues, while 5xx indicates server-side failure or unavailable upstream behavior.
Can this help improve API monitoring?
Yes, understanding status semantics enables better alert thresholds and faster diagnosis of incident patterns.