Loading…
|
Translation changed |
|
|
String added in the repository |
|
Loading…
|
Translation changed |
|
|
String added in the repository |
|
This option controls whether or not the parser expects to see an HTTP body, regardless of the presence or absence of certain fields such as Content-Length or a chunked Transfer-Encoding. Depending on the request, some responses do not carry a body. For example, a 200 response to a [@https://tools.ietf.org/html/rfc7231#section-4.3.6 CONNECT] request from a tunneling proxy, or a response to a [@https://tools.ietf.org/html/rfc7231#section-4.3.2 HEAD] request. In these cases, callers may use this function inform the parser that no body is expected. The parser will consider the message complete after the header has been received.该选项用于控制解析器是否期待接收 HTTP 消息体,这个判断独立于 Content-Length 或分块传输编码等字段是否存在。某些类型的响应本身就不包含消息体。例如,隧道代理对 CONNECT 请求返回的 200 响应,或者对 HEAD 请求的响应。在这些场景下,调用方可以使用该函数告知解析器不需要消息体。解析器在收到头部后就会将消息视为已完整接收。