Loading…
|
Translation changed |
|
|
String added in the repository |
|
Loading…
|
Translation changed |
|
|
String added in the repository |
|
The请求中的 Expectfield with the value "100-continue" in a request is special. It indicates that the after sending the message header, a client desires an immediate informational response before sending the message body, which presumably may be expensive to compute or large. This behavior is described in [@https://tools.ietf.org/html/rfc7231#section-5.1.1 rfc7231 section 5.1.1]. Invoking the 100-continue behavior is implemented easily in a client by constructing a __serializer__ to send the header first, then receiving the server response, and finally conditionally send the body using the same serializer instance. A synchronous, simplified version (no timeout) of this client action looks like this:字段若值为 `100-continue`,则具有特殊含义。它表示客户端在发送消息头部之后,希望在发送消息体之前立即收到一个信息性响应。这通常是因为消息体的计算开销较大或数据量较大。[@https://tools.ietf.org/html/rfc7231#section-5.1.1 rfc7231 第 5.1.1 节] 对此行为进行了详细说明。在客户端实现 100-continue 行为比较简单:先构造 __serializer__ 发送头部,然后接收服务器响应,最后根据情况使用同一个序列化器实例发送消息体。以下是一个同步的简化版本(不含超时)的实现: