http状态码含义

在开发的过程当中,由于操作疏忽或者其他的原因,我们在前后台数据交互或者前台页面中经常出现错误,这时候浏览器会给我们反馈回一个状态码,但是我们有的时候并不知道这个状态码代表的实际意思。下面是常见的状态码总结,如下:

1.以“1”开头的,代表已经接收到请求,整个交互正在进行中。 

  - 1xx: Informational - Request received, continuing process

2.以“2”开头的,代表请求正确接收,响应成功。

  - 2xx: Success - The action was successfully received, understood, and accepted

3.以“3”开头的,代表重定向,即:向服务器发送的请求需要进行请求转接,执行多次请求来实现响应。

  - 3xx: Redirection - Further action must be taken in order to complete the request

4.以“4”开头的,代表客户端出错,也就是说客户端(前台)的请求包含语法错误导致请求不能执行(多为路径不对)。

  - 4xx: Client Error - The request contains bad syntax or cannot be fulfilled

5.以“5”开头的,代表服务器出错,导致请求不能有效的执行。

  - 5xx: Server Error - The server failed to fulfill an apparently valid request


具体状态码如下:

Status-Code    =
            "100"  ; Section 10.1.1: Continue
          | "101"  ; Section 10.1.2: Switching Protocols
          | "200"  ; Section 10.2.1: OK
          | "201"  ; Section 10.2.2: Created
          | "202"  ; Section 10.2.3: Accepted
          | "203"  ; Section 10.2.4: Non-Authoritative Information
          | "204"  ; Section 10.2.5: No Content
          | "205"  ; Section 10.2.6: Reset Content
          | "206"  ; Section 10.2.7: Partial Content
          | "300"  ; Section 10.3.1: Multiple Choices
          | "301"  ; Section 10.3.2: Moved Permanently
          | "302"  ; Section 10.3.3: Found
          | "303"  ; Section 10.3.4: See Other
          | "304"  ; Section 10.3.5: Not Modified
          | "305"  ; Section 10.3.6: Use Proxy
          | "307"  ; Section 10.3.8: Temporary Redirect
          | "400"  ; Section 10.4.1: Bad Request
          | "401"  ; Section 10.4.2: Unauthorized
          | "402"  ; Section 10.4.3: Payment Required
          | "403"  ; Section 10.4.4: Forbidden
          | "404"  ; Section 10.4.5: Not Found
          | "405"  ; Section 10.4.6: Method Not Allowed
          | "406"  ; Section 10.4.7: Not Acceptable
          | "407"  ; Section 10.4.8: Proxy Authentication Required
          | "408"  ; Section 10.4.9: Request Time-out
          | "409"  ; Section 10.4.10: Conflict
          | "410"  ; Section 10.4.11: Gone
          | "411"  ; Section 10.4.12: Length Required
          | "412"  ; Section 10.4.13: Precondition Failed
          | "413"  ; Section 10.4.14: Request Entity Too Large
          | "414"  ; Section 10.4.15: Request-URI Too Large
          | "415"  ; Section 10.4.16: Unsupported Media Type
          | "416"  ; Section 10.4.17: Requested range not satisfiable
          | "417"  ; Section 10.4.18: Expectation Failed
          | "500"  ; Section 10.5.1: Internal Server Error
          | "501"  ; Section 10.5.2: Not Implemented
          | "502"  ; Section 10.5.3: Bad Gateway
          | "503"  ; Section 10.5.4: Service Unavailable
          | "504"  ; Section 10.5.5: Gateway Time-out
          | "505"  ; Section 10.5.6: HTTP Version not supported

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
HTTP状态码是指在HTTP协议通信过程中,服务器向客户端返回的标识其处理状态的3位数字代码。HTTP状态码的第一位数字代表了当前响应的类型,后两位数字不分类。 常见的HTTP状态码及其含义如下: - 1xx:信息性状态码,表示接收到请求正在处理。 - 100 Continue:客户端应当继续发送请求。服务器已收到请求的一部分,并且服务器仍未收到请求的剩余部分。 - 101 Switching Protocols:服务器已经理解了客户端的请求,并将通过Upgrade消息头通知客户端采用不同的协议来完成这个请求。 - 2xx:成功状态码,表示请求已被接受并成功处理。 - 200 OK:请求成功。一般用于GET和POST请求。 - 201 Created:已创建。成功请求并创建了新的资源。 - 204 No Content:无内容。服务器成功处理,但没有返回任何内容。 - 3xx:重定向状态码,表示客户端需要采取进一步的操作才能完成请求。 - 301 Moved Permanently:永久移动。请求的网页已永久移动到新位置。 - 302 Found:临时移动。请求的网页已临时移动到新位置。 - 304 Not Modified:未修改。请求的资源未更新。 - 4xx:客户端错误状态码,表示客户端发送的请求有误。 - 400 Bad Request:请求出错。请求中有语法问题。 - 401 Unauthorized:未授权。请求需要用户验证。 - 403 Forbidden:禁止访问。服务器拒绝请求。 - 5xx:服务器错误状态码,表示服务器处理请求出错。 - 500 Internal Server Error:服务器内部错误。请求未完成,服务器遇到错误。 - 503 Service Unavailable:服务不可用。服务器当前无法处理请求。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值