HTTP 状态码及含义

栏目: 后端 · 前端 · 发布时间: 4年前

内容简介:来自

来自 Koa.js 官方文档 中关于设置请求响应的部分 response.status= ,列出了从 1xx ~ 5xx HTTP 状态码及含义,现摘录如下:

  • 100 "continue"
  • 101 "switching protocols"
  • 102 "processing"
  • 200 "ok"
  • 201 "created"
  • 202 "accepted"
  • 203 "non-authoritative information"
  • 204 "no content"
  • 205 "reset content"
  • 206 "partial content"
  • 207 "multi-status"
  • 208 "already reported"
  • 226 "im used"
  • 300 "multiple choices"
  • 301 "moved permanently"
  • 302 "found" 资源临时不可用,但在其他位置找到了,返回 302 同时带上 Location: 新的资源地址 响应头。客户端根据新地址再次请求。
    • 假如第一次请求使用的 POST,后面这次重新请求浏览器有可能变成 GET。
    • 如果想要两次请求保持一致的请求方式,使用 307
    • 运用场景:某些原因资源无法访问了,此时为了不让搜索引擎更新,可使用 302 告诉引擎资源还在。
  • 303 "see other"
  • 304 "not modified"
  • 305 "use proxy"
  • 307 "temporary redirect"
    • 和 302 一模一样,区别在于两次请求保持一致的 http verb
  • 308 "permanent redirect"
  • 400 "bad request"
    • 由于请求有语法错误,服务器不能识别
  • 401 "unauthorized"
  • 402 "payment required"
  • 403 "forbidden"
  • 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 "payload too large"
    • 比如 post 的数据也就是request body过大
  • 414 "uri too long"
  • 415 "unsupported media type"
  • 416 "range not satisfiable"
  • 417 "expectation failed"
  • 418 "I'm a teapot"
  • 422 "unprocessable entity"
  • 423 "locked"
  • 424 "failed dependency"
  • 426 "upgrade required"
  • 428 "precondition required"
  • 429 "too many requests"
  • 431 "request header fields too large"
  • 500 "internal server error"
  • 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"
  • 510 "not extended"
  • 511 "network authentication required"

以上所述就是小编给大家介绍的《HTTP 状态码及含义》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

计算机图形学

计算机图形学

[美]PeterShirley / 高春晓、赵清杰、张文耀 / 人民邮电出版社 / 2007-6 / 49.00元

本书是国外高校采用率很高的计算机图形学教材,共分为26章,全面系统地讲解了计算机图形学的基本概念和相关技术。书中先介绍图形学相关的数学知识,然后依次讲解图形学的光栅算法、三三维观察、隐藏面消除、光照、纹理、绘制等算法和理论,并介绍可视感知、计算机动画、基于图像的绘制、可视化以及构建交互式图形应用等。 本书可作为信息技术等相关专业本科生、研究生计算机图形学课程的教材,也可以作为计算机图形学工作......一起来看看 《计算机图形学》 这本书的介绍吧!

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具