根据规范,需要使用Transfer-Encoding才能使分块行为正常工作。
但是,在调试过程中我发现当标题不在响应中时,客户端似乎处理它就好了。
tcpdump trace大概是:
没有Transfer-Encoding标头:
HTTP GET equest
HTTP 200 ok response
a list of Continuation or non-http traffic, of various sizes
8258 Continuation or non-HTTP traffic
16450 Continuation or non-HTTP traffic
使用Transfer-encoding标头:
HTTP GET equest
HTTP 200 ok response
a list of Continuation or non-http traffic, of same size
8266 Continuation or non-HTTP traffic
客户端(curl)似乎不依赖于传输编码头?如果是这样,它怎么知道?
谢谢,