Can you explain chunked encoding?

不问归期 提交于 2021-02-10 08:33:07

问题


header("Transfer-Encoding: chunked");
echo"32
12345678901234567890123456789012345678901234567890
0
"; flush();exit;

When requested with Firefox, 32 and 0 are missing. Why?


回答1:


The chunked transfer encoding is a sequence of chunks where each chunk consists of at least a size indicator and the chunk data.

In this case 32 and 0 are the size indicators in hexadecimal notation that denote the length of the following chunk data. A chunk size of 0 denotes the end of the chunked data stream.



来源:https://stackoverflow.com/questions/3829145/can-you-explain-chunked-encoding

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!