1

我在我的 ubuntu telnet 客户端中尝试了这个:

> telnet www.google.com 80
> GET / HTTP/1.1

我得到的是控制台中的一堆 HTML 行。我注意到最后一行末尾的一件事,就在关闭标签 /Script 之后。有一个字符'0'......这是什么意思?

4

2 回答 2

5

At the start of the response you will see:

Transfer-Encoding: chunked

1000

HTTP chunked transfer encoding means that the server doesn't know in advance how big the Content-Length of the response is going to be, so it'll give you it a bit at a time. This type of response is typical for server-side scripts, when the web server wants to start sending back script results to the user before the script has completely finished.

So the 1000 is a sign that there's a block of 4096 (0x1000) bytes to follow: <!doctype html><html><head><meta.... After 1000 bytes you get another chunk header saying (in my request) f65, meaning 3941 more bytes. After that, cc0 (3264 more bytes) and finally 0 which is a signal that the response is complete.

于 2010-11-12T00:46:06.487 回答
0

文件结束,EOF。

于 2010-11-12T00:26:33.347 回答