引用自 wikipedia https://en.wikipedia.org/wiki/List_of_HTTP_status_codes

4xx Client errors

The 4xx class of status codes is intended for situations in which the client seems to have erred. Except when responding to a HEAD request, the servershouldinclude an entity containing an explanation of the error situation, and whether it is a temporary or permanent condition. These status codes are applicable to any request method. User agentsshoulddisplay any included entity to the user. [31]

400 Bad Request
The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, too large size, invalid request message framing, or deceptive request routing).[32]
401 Unauthorized (RFC 7235)
Similar to403 Forbidden, but specifically for use when authentication is required and has failed or has not yet been provided. The response must include a WWW-Authenticate header field containing a challenge applicable to the requested resource. SeeBasic access authenticationandDigest access authentication.[33]401 semantically means"unauthenticated",[34]i.e. the user does not have the necessary credentials.
Note: Some sites issue HTTP 401 when anIP addressis banned from the website (usually the website domain) and that specific address is refused permission to access a website.
402 Payment Required
Reserved for future use. The original intention was that this code might be used as part of some form ofdigital cashormicropaymentscheme, but that has not happened, and this code is not usually used.Google DevelopersAPI uses this status if a particular developer has exceeded the daily limit on requests.[35]
403 Forbidden
The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource.
404 Not Found
The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible.[36]
405 Method Not Allowed
A request method is not supported for the requested resource; for example, a GET request on a form that requires data to be presented viaPOST, or a PUT request on a read-only resource.
406 Not Acceptable
The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.[37]SeeContent negotiation.
407 Proxy Authentication Required (RFC 7235)
The client must first authenticate itself with theproxy.[38]
408 Request Time-out
The server timed out waiting for the request. According to HTTP specifications: "The client did not produce a request within the time that the server was prepared to wait. The client MAY repeat the request without modifications at any later time."[39]
409 Conflict
Indicates that the request could not be processed because of conflict in the request, such as anedit conflictbetween multiple simultaneous updates.
410 Gone
Indicates that the resource requested is no longer available and will not be available again. This should be used when a resource has been intentionally removed and the resource should be purged. Upon receiving a 410 status code, the client should not request the resource in the future. Clients such as search engines should remove the resource from their indices.[40]Most use cases do not require clients and search engines to purge the resource, and a "404 Not Found" may be used instead.
411 Length Required
The request did not specify the length of its content, which is required by the requested resource.[41]
412 Precondition Failed (RFC 7232)
The server does not meet one of the preconditions that the requester put on the request.[42]
413 Payload Too Large (RFC 7231)
The request is larger than the server is willing or able to process. Previously called "Request Entity Too Large".[43]
414 URI Too Long (RFC 7231)
TheURIprovided was too long for the server to process. Often the result of too much data being encoded as a query-string of a GET request, in which case it should be converted to a POST request.[44]Called "Request-URI Too Long" previously.[45]
415 Unsupported Media Type
The request entity has amedia typewhich the server or resource does not support. For example, the client uploads an image asimage/svg+xml, but the server requires that images use a different format.
416 Range Not Satisfiable (RFC 7233)
The client has asked for a portion of the file (byte serving), but the server cannot supply that portion. For example, if the client asked for a part of the file that lies beyond the end of the file.[46]Called "Requested Range Not Satisfiable" previously.[47]
417 Expectation Failed
The server cannot meet the requirements of the Expect request-header field.[48]
418 I'm a teapot (RFC 2324)
This code was defined in 1998 as one of the traditionalIETFApril Fools' jokes, inRFC 2324,Hyper Text Coffee Pot Control Protocol, and is not expected to be implemented by actual HTTP servers. The RFC specifies this code should be returned by teapots requested to brew coffee.[49]This HTTP status is used as anEaster eggin some websites, includingGoogle.com.[50]
421 Misdirected Request (RFC 7540)
The request was directed at a server that is not able to produce a response (for example because a connection reuse).[51]
422 Unprocessable Entity (WebDAV;RFC 4918)
The request was well-formed but was unable to be followed due to semantic errors.[15]
423 Locked (WebDAV;RFC 4918)
The resource that is being accessed is locked.[15]
424 Failed Dependency (WebDAV;RFC 4918)
The request failed due to failure of a previous request (e.g., a PROPPATCH).[15]
426 Upgrade Required
The client should switch to a different protocol such asTLS/1.0, given in theUpgrade headerfield.[52]
428 Precondition Required (RFC 6585)
The origin server requires the request to be conditional. Intended to prevent "the 'lost update' problem, where a client GETs a resource's state, modifies it, and PUTs it back to the server, when meanwhile a third party has modified the state on the server, leading to a conflict."[53]
429 Too Many Requests (RFC 6585)
The user has sent too many requests in a given amount of time. Intended for use withrate-limitingschemes.[53]
431 Request Header Fields Too Large (RFC 6585)
The server is unwilling to process the request because either an individual header field, or all the header fields collectively, are too large.[53]
451 Unavailable For Legal Reasons(RFC 7725)
A server operator has received a legal demand to deny access to a resource or to a set of resources that includes the requested resource.[54]The code 451 was chosen as a reference to the novelFahrenheit 451.

5xx Server error[edit]

The server failed to fulfill an apparently valid request

Response status codes beginning with the digit "5" indicate cases in which the server is aware that it has encountered an error or is otherwise incapable of performing the request. Except when responding to a HEAD request, the server should include an entity containing an explanation of the error situation, and indicate whether it is a temporary or permanent condition. Likewise, user agents should display any included entity to the user. These response codes are applicable to any request method.[56]

500 Internal Server Error
A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.[57]
501 Not Implemented
The server either does not recognize the request method, or it lacks the ability to fulfill the request. Usually this implies future availability (e.g., a new feature of a web-service API).[58]
502 Bad Gateway
The server was acting as agatewayor proxy and received an invalid response from the upstream server.[59]
503 Service Unavailable
The server is currently unavailable (because it is overloaded or down for maintenance). Generally, this is a temporary state.[60]
504 Gateway Time-out
The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.[61]
505 HTTP Version Not Supported
The server does not support the HTTP protocol version used in the request.[62]
506 Variant Also Negotiates (RFC 2295)
Transparentcontent negotiationfor the request results in acircular reference.[63]
507 Insufficient Storage (WebDAV;RFC 4918)
The server is unable to store the representation needed to complete the request.[15]
508 Loop Detected (WebDAV;RFC 5842)
The server detected an infinite loop while processing the request (sent in lieu of208 Already Reported).
510 Not Extended (RFC 2774)
Further extensions to the request are required for the server to fulfill it.[64]
511 Network Authentication Required (RFC 6585)

The client needs to authenticate to gain network access. Intended for use by intercepting proxies used to control access to the network (e.g., "captive portals" used to require agreement to Terms of Service before granting full Internet access via a Wi-Fi hotspot).[53]

根据平时常用的几个,总结下:

400 Bad Request 请求参数
401 Unauthorized 同403类似,区别是适用需要授权票据(http header Authorization),但票据校验失败或未提供的场景
403 Forbidden 禁止访问,用户没有对资源访问需要的权限
404 Not Foud 请求地址不存在对应处理器映射

500 Internal Server Error作为服务器服务报错/异常的代码;
501 Not Implement 服务未实现的方法,如服务端不支持PATCH请求,客户端PATCH类型请求,就会返回的状态码
502 Bad Gateway 通常是未发布好,或者主机地址未正确解析(如今天遇到的移动端忘记配Host就访问API)
503 Service Unavailable 当前无法访问,体现的是一种临时的状态
504 Gateway Timeout请求服务超时未返回

http 4xx,5xx Server error相关推荐

  1. LiveNVR直播Onvif/RTSP视频流媒体平台遇到离线显示Server returned 5XX Server Error reply如何处理问题分析RTSP借一还多

    LiveNVR 离线Server returned 5XX Server Error reply如何处理问题分析 1.视频广场显示离线 2.尝试VLC是否可以播放 2.1.不能播放 2.2.可以播放 ...

  2. 各种HTTP返回错误代码大全 HTTP 403 Forbidden / 404 Not Found / 500 Internal Server Error / 502 Bad Gateway / 50

    转载自:http://targetcn.com/?p=52#comment-90 现在上网经常发现各种不能访问的页面,搜索引擎里看的到点开链接却404了,聪明的你当然知道看搜索引擎缓存页面啦,但是你是 ...

  3. web应用F12查看报错(前后端bug判断、2XX/3XX/4XX/5XX常见状态码解析)

    chrom浏览器为例 (1)打开开发者工具,在浏览器菜单栏选择工具-开发者工具,快捷键是F12 (2)打开之后切换到Network页签,操作就可以看到请求响应 (3)再选择响应的链接,切换到Previ ...

  4. HTTP 错误 500.21 - Internal Server Error 解决方案

    不久前重新安装了Windows7,在安装了VS2010 开发平台之后,将网站发布到IIS,访问发生如下错误: HTTP 错误 500.21 - Internal Server Error处理程序&qu ...

  5. HTTP 错误 500.21 - Internal Server Error

    HTTP 錯誤 500.21 - Internal Server Error 處理常式 "PageHandlerFactory-Integrated" 的模組清單中有錯誤的模組 & ...

  6. Windows 7 IIS (HTTP Error 500.21 - Internal Server Error)解决

    今天在测试网站的时候,在浏览器中输入http://localhost/时,发生如下错误: HTTP Error 500.21 - Internal Server Error Handler " ...

  7. 500 - Internal server error.

    Server Error 500 - Internal server error. There is a problem with the resource you are looking for, ...

  8. 解决IIS中HTTP/1.1 500 Server Error错误的方法

    最近用VS.NET做网站,但在建立WEB平台是总出现" HTTP/1.1 500 Server Error"的错误,上网查了N多人说的N多的解决方案都不好使,郁闷了好久,好在搜到了 ...

  9. SpringWeb 系列教程 RestTemplate 4xx/5xx 异常信息捕获

    SpringWeb 系列教程 RestTemplate 4xx/5xx 异常信息捕获 参考文章: (1)SpringWeb 系列教程 RestTemplate 4xx/5xx 异常信息捕获 (2)ht ...

最新文章

  1. tenginx配置负载均衡
  2. 【pmcaff】事件营销口碑传播疯传的秘诀在哪里?
  3. AndFix解析——(上)
  4. 光流 | 基于Matlab实现Lucas-Kanade方法:方法2(附源代码)
  5. VTK:Video之FFMPEG
  6. 【STM32】STM32F4系统架构
  7. c#目录以及子目录下图片批量缩放,像素不变,图像大小改变
  8. Flask-SQLAlchemy - 不使用外键连表查询。记得常回来看我
  9. WPS文字2013利用绘图工具中的形状裁剪出各式各样的图片
  10. python萌新笔记----基于requests库请求API下载网易云(VIP)音乐
  11. 软考:软件设计师(中级)
  12. JS实现自定义右键菜单
  13. sqlite创建表格
  14. 使用mysql创建表格
  15. 题解 SP4487 【GSS6 - Can you answer these queries VI】
  16. 高效能人士的七个习惯--由内而外全面造就自己
  17. HTML期末大学生网页设计作业--官网仿qq音乐(1页)
  18. 记录下:订单模块初步完成
  19. IOS 安卓 按键精灵 触动精灵脚本逆向解密
  20. ubuntu添加自定义vga输出分辨率

热门文章

  1. bucket list 函数解析
  2. 【转】我奋斗了18年不是为了和你一起喝咖啡
  3. 高分屏笔记本显示模糊解决方法
  4. node.js+小程序基于微信小程序的校园失物招领系统毕业设计源码072343
  5. F. Floor Plan
  6. 详细的买卖天猫店铺网店转让步骤
  7. 基于KF32A156 - MCU Bug list
  8. 艺赛旗(RPA)Numpy 入门学习
  9. python画小狗代码_用Python画一只有点方的小狗狗——turtle库circle()函数实践
  10. java无法解析zip