Chunked transfer encoding是http1.1中的一种数据传输机制。
refer:
Chunked transfer encoding is a data transfer mechanism in version 1.1 of the Hypertext Transfer Protocol (HTTP) in which a web server serves content in a series of chunks. It uses the Transfer-Encoding HTTP response header in place of the Content-Length header, which the protocol would otherwise require. Because the Content-Length header is not used, the server does not need to know the length of the content before it starts transmitting a response to the client (usually a web browser). Web servers can begin transmitting responses with dynamically-generated content before knowing the total size of that content.
The size of each chunk is sent right before the chunk itself so that a client can tell when it has finished receiving data for that chunk. The data transfer is terminated by a final chunk of length zero.
example:
HTTP/1.1 200 OK Content-Type: text/plain Transfer-Encoding: chunked 25 This is the data in the first chunk 1C and this is the second one 3 con 8 sequence 0
分块传输编码是HTTP 1.1中的一种数据传输机制,允许Web服务器在不知道内容总长度的情况下发送响应。它使用Transfer-Encoding响应头替代Content-Length头,使服务器能在确定内容大小之前开始传输动态生成的内容。

1360

被折叠的 条评论
为什么被折叠?



