【HTTP】状态码表速查

分类

码表

RFC2616规范上的HTTP状态码就达40种,若再加上扩展,数量就达60余种,经常使用的大概只有14种:

200、204、206

301、302、303、304、307

400、401、403、404

500、503

类型 状态码 描述
1xx消息 100 Continue
101 Switching Protocols
102 Processing
2xx成功 200 OK 成功
201 Created
202 Accepted
203 Non Authoritative information
204

No Content

请求已成功处理,但在返回的响应报文中不含实体的主体部分

205 Reset Content
206

Partial Content

客户端进行了范围Content-Range请求,而服务器成功执行了这部分的GET请求。

响应报文中包含由Content-Range指定范围的实体内容。

207 Multi-Status
208 Already Reported
226 IM Used
3xx重定向 300 Multiple Choices
301

Moved Permanently

永久性重定向。

该状态码表示请求的资源已被分配了新的URI(Location首部字段),以后应使用资源现在所指的URI

302

Found

临时性重定向

请求的资源已被分配了新的URI,希望用户(本次)能使用新的URI访问。

303

See Other

与302类似,区别在于客户端应当采用GET方法获取资源

304

Not Modified

请求带条件,if-not-modified

服务器端资源未改变,可直接使用客户端未过期的缓存

305 Use Proxy
306 Switch Proxy
307

Temporary Redirect

临时重定向。该状态码与302 Found有着相同的含义

308 Permanent Redirect
4xx请求错误 400

Bad Request

请求报文中存在语法错误

401

Unauthorized

需要有通过HTTP认证(BASIC认证、DIGEST认证)的认证

402 Payment Required
403

Forbidden

访问权限出现某些问题(从未授权的发送源IP地址试图访问)

404

Not Found

服务器上无法找到请求的资源

405 Method Not Allowed
406 Not Acceptable
407 Proxy Authentication Required
408 Request Timeout
409 Conflict
410 Gone
411 Length Required
412 Precondition Failed
413 Request Entity Too Large
414 Request-URI Too Long
415 Unsupported Media Type
416 Requested Range Not Satisfiable
417 Expectation Failed
418 I'm a teapot.
419 Authentication Timeout
420 Enhance Your Caim
421 Misdirected Request
422 Unprocessable Entity
423 Locked
424 Failed Dependency
425 Too Early
426 Upgrade Required
428 Precondition Required
429 Too Many Requests
431 Request Header Fields Too Large
444 No Response
450 Blocked by Windows Parental Controls
451 Unavailable For Legal Reasons
494 Request Header Too Large
499 客户端等待超时主动断开连接,nginx返回
5xx服务器错误 500

Internal Server Error

服务器端在执行请求时发生了错误,Web应用存在的bug或某些临时的故障,服务端抛异常没有兜住封装错误码

501 Not Implemented
502

Bad Gateway

上游服务不可用

503 Service Unavailable
超负载或正在进行停机维护,现在无法处理请求
504 Gateway Timeout
505 Http Version Not Supported
506 Variant Also Negotiates
507 Insufficient Storage
508 Loop Detected
509 Bandwidth Limit Exceeded
510 Not Extended
511 Network Authentication Required
发布了132 篇原创文章 · 获赞 122 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/sarafina527/article/details/105381984