关于http状态码

  1. 200 OK
  2. 301 Moved Permanently
  3. 302 Found
  4. 304 Not Modified
  5. 307 Temporary Redirect
  6. 400 Bad Request
  7. 401 Unauthorized
  8. 403 Forbidden
  9. 404 Not Found
  10. 410 Gone
  11. 500 Internal Server Error
  12. 501 Not Implemented

HTTP Status Code - 200OK

The request has succeeded. The information returned with theresponse is dependent on the method used in therequest.(一切正常,对GET和POST请求的应答文档跟在后面)

HTTP Status Code - 301 MovedPermanently

The requested resource has been assigned a new permanent URI andany future references to this resource SHOULD use one of thereturnedURIs.(客户请求的文档在其他地方,新的URL在Location头中给出,浏览器应该自动地访问新的URL。)

HTTP Status Code - 302Found

The requested resource resides temporarily under a differentURI. Since the redirection might be altered on occasion, the clientSHOULD continue to use the Request-URI for future requests.

HTTP Status Code - 304 NotModified

If the client has performed a conditional GET request and accessis allowed, but the document has not been modified, the serverSHOULD respond with this status code. The 304 response MUST NOTcontain a message-body, and thus is always terminated by the firstempty line after the headerfields.(类似于301,但新的URL应该被视为临时性的替代,而不是永久性的。)

HTTP Status Code - 307 TemporaryRedirect

The requested resource resides temporarily under a differentURI. Since the redirection MAY be altered on occasion, the clientSHOULD continue to use the Request-URI for future requests. Thisresponse is only cacheable if indicated by a Cache-Control orExpires header field.(和302(Found)相同。许多浏览器会错误地响应302应答进行重定向,即使原来的请求是POST,即使它实际上只能在POST请求的应答是303时才能重定向。由于这个原因,HTTP1.1新增了307,以便更加清除地区分几个状态代码:当出现303应答时,浏览器可以跟随重定向的GET和POST请求;如果是307应答,则浏览器只能跟随对GET请求的重定向。)

HTTP Status Code - 400 BadRequest

The request could not be understood by the server due tomalformed syntax. The client SHOULD NOT repeat the request withoutmodifications.(请求出现语法错误。)

HTTP Status Code - 401Unauthorized

The request requires user authentication. The response MUSTinclude a WWW-Authenticate header field containing a challengeapplicable to the requestedresource.(客户试图未经授权访问受密码保护的页面。应答中会包含一个WWW-Authenticate头,浏览器据此显示用户名字/密码对话框,然后在填写合适的Authorization头后再次发出请求。)

HTTP Status Code - 403Forbidden

The server understood the request, but is refusing to fulfillit. Authorization will not help and the request SHOULD NOT berepeated.(资源不可用。)

HTTP Status Code - 404 NotFound

The server has not found anything matching the Request-URI. Noindication is given of whether the condition is temporary orpermanent.(无法找到指定位置的资源)

HTTP Status Code - 410Gone

The requested resource is no longer available at the server andno forwarding address is known. This condition is expected to beconsidered permanent. Clients with link editing capabilities SHOULDdelete references to the Request-URI after userapproval.(所请求的文档已经不再可用,而且服务器不知道应该重定向到哪一个地址。它和404的不同在于,返回407表示文档永久地离开了指定的位置,而404表示由于未知的原因文档不可用。)

HTTP Status Code - 500 InternalServer Error

The server encountered an unexpected condition which preventedit from fulfilling the request.(服务器遇到了意料不到的情况,不能完成客户的请求)

扫描二维码关注公众号,回复: 5817593 查看本文章

HTTP Status Code - 501 NotImplemented

The server does not support the functionality required tofulfill the request. This is the appropriate response when theserver does not recognize the request method and is not capable ofsupporting it for anyresource.(服务器不支持实现请求所需要的功能。例如,客户发出了一个服务器不支持的PUT请求)
转载自http://blog.sina.com.cn/s/blog_5f7b8c2c0100d6mb.html

猜你喜欢

转载自blog.csdn.net/m943917709/article/details/79811095