数字在http标头和内容中间的含义是什么

时间:2011-04-16 14:29:03

标签: sockets network-programming http-headers

我正在编写一个类似于浏览器的程序,但更简单。用户键入一个链接,程序将其保存到本地文件中。

我发送了一个像这样的http标题:

GET /index.php HTTP/1.1\r\n
Host: www.highradio.tw\r\n
\r\n
然后我收到了:

HTTP/1.1 200 OK
Date: Sat, 16 Apr 2011 14:16:29 GMT
Server: Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8q mod_wsgi/3.3 Python/2.7.1 PHP/5.2.5 (x64)
X-Powered-By: PHP/5.2.5 (x64)
Set-Cookie: PHPSESSID=d0ug0im94rg7lrjp40h38vo784; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Vary: Accept-Encoding
Transfer-Encoding: chunked
Content-Type: text/html

204a
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
....

数字是什么(在HEX?中)204a是什么意思?

当我在终端中使用Chrome或wget时,204a不会显示。

1 个答案:

答案 0 :(得分:2)

该十六进制值表示后续块中的字节数。

查看维基百科上的Chunked transfer encoding页面,它会告诉您这个号码是什么。