怎样接收http响应(http response)

来源:互联网 发布:caffe concat axis 编辑:程序博客网 时间:2024/06/11 01:57

http到response中有一个头叫做Content-Length,代表body有多少字节。

但是如果response中没有这个头,一般就是所谓的chunked接收了,这时候会有另外一个头

Transfer-Encoding: chunked

代表字节数在body中,如:

a1

<html>

...

</html>

0

其中a1是16进制数字,也就是说有161个字节需要传输,最后的0代表这次应答完毕。

原文:http://blog.csdn.net/hongchangfirst/article/details/8705053

作者:hongchangfirst

hongchangfirst的主页:http://blog.csdn.net/hongchangfirst