1xx-响应信息提示

title

1xx 状态代码表示临时的响应。客户端在收到常规响应之前,应准备接收一个或多个1xx

HTTP/1xx(信息性状态码)是指服务器接收到请求,正在进一步处理请求,需要客户端继续发送请求才能完成操作的状态码。

以下是常见的HTTP/1xx状态码:

  • 100 Continue:表示服务器已经收到了请求头,并且客户端应该继续发送请求体(通常是上传文件时)。
  • 101 Switching Protocols:表示服务器正在根据客户端的请求切换协议。
  • 102 Processing:表示服务器正在处理请求,但需要很长时间才能完成,客户端应该持续等待。

HTTP/1xx状态码属于临时响应,一般情况下不会被缓存。

Informational 1xx

   This class of status code indicates a provisional response,
   consisting only of the Status-Line and optional headers, and is
   terminated by an empty line. There are no required headers for this
   class of status code. Since HTTP/1.0 did not define any 1xx status
   codes, servers MUST NOT send a 1xx response to an HTTP/1.0 client
   except under experimental conditions.

   A client MUST be prepared to accept one or more 1xx status responses
   prior to a regular response, even if the client does not expect a 100
   (Continue) status message. Unexpected 1xx status responses MAY be
   ignored by a user agent.

   Proxies MUST forward 1xx responses, unless the connection between the
   proxy and its client has been closed, or unless the proxy itself
   requested the generation of the 1xx response. (For example, if a
   proxy adds a "Expect: 100-continue" field when it forwards a request,
   then it need not forward the corresponding 100 (Continue)
   response(s).)

100 | 101

更多1xx

powered by Gitbook© 2023 编外计划 | 最后修改: 2023-11-24 03:36:58

results matching ""

    No results matching ""