89520292 2013-05-22
例:向 http://www.baidu.com 发送HTTP请求报文信息
1.CMD中输入:
telnet www.baidu.com 80
2.输入请求报文:然后两次回车换行。 【可以在FireFox下查看这些请求/响应的报文信息】
GET /index.php HTTP/1.1
Host: www.baidu.com:8088
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: zh-cn,zh;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: GB2312,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Cookie: JSESSIONID=C6C21E45C94452A8352A94267688B0F6
Cache-Control: max-age=0
精简请求报文:然后两次回车换行
HEAD / HTTP/1.0
3.响应报文头:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=UTF-8
Content-Length: 963
Date: Mon, 28 Jun 2010 14:57:10 GMT
4.发送POST请求:(参数行与header行之间要有一空行,最后要有2个回车换行。)