http header 和内容中间的数字是什么意思
我正在编写一个类似于浏览器但更简单的程序。用户键入链接,程序将其保存到本地文件中。
我发送了这样的 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">
....
这个数字(十六进制?)204a
是什么意思?
当我在终端中使用 Chrome 或 wget
时,204a
不会显示。
I'm writing a program that is similar to a browser but much more simple. The user types a link and the program saves it to a file in local.
I sent an http header like this:
GET /index.php HTTP/1.1\r\n
Host: www.highradio.tw\r\n
\r\n
then I received:
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">
....
What does the number (in HEX?) 204a
mean?
When I use Chrome or wget
in terminal, the 204a
doesn't show up.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该十六进制值表示后续块中的字节数。
查看 Wikipedia 上的分块传输编码页面,它会告诉您该数字是多少。
That hex value represents the number of bytes in the following chunk.
Check out the Chunked transfer encoding page on Wikipedia, it will tell you what that number is.