常用的 http 状态码有哪些?

http 状态码

在我们进行网页,网址的访问过程中,http,https 都是我们主要使用到的协议,在使用这协议的时候,对于他的协助状态,我们是需要完全正确理解,从而才有可能更好的理解这套协议的初衷。

常用的 HTTP 状态码包括:

  1. 1xx 信息性状态码(Informational):
    • 100 Continue
    • 101 Switching Protocols
  2. 2xx 成功状态码(Successful):
    • 200 OK
    • 201 Created
    • 202 Accepted
    • 204 No Content
    • 206 Partial Content
  3. 3xx 重定向状态码(Redirection):
    • 300 Multiple Choices
    • 301 Moved Permanently
    • 302 Found
    • 304 Not Modified
    • 307 Temporary Redirect
    • 308 Permanent Redirect
  4. 4xx 客户端错误状态码(Client Error):
    • 400 Bad Request
    • 401 Unauthorized
    • 403 Forbidden
    • 404 Not Found
    • 405 Method Not Allowed
    • 406 Not Acceptable
    • 407 Proxy Authentication Required
    • 408 Request Timeout
    • 409 Conflict
    • 410 Gone
    • 429 Too Many Requests
  5. 5xx 服务器错误状态码(Server Error):
    • 500 Internal Server Error
    • 501 Not Implemented
    • 502 Bad Gateway
    • 503 Service Unavailable
    • 504 Gateway Timeout
    • 505 HTTP Version Not Supported

这些状态码用于表示客户端与服务器之间的交互状态,帮助客户端和服务器进行正确的处理和响应。

参考

常用的 http 状态码有哪些?
HTTP状态码
HTTP状态码详解
面试官:说说HTTP 常见的状态码有哪些,适用场景?

Leave a Reply