报文
一个URL为"http://www.zhiliaowang.com/toupiaoceshi.asp?name=朱云翔"的GET请求报文例子如下:
系统帮忙封装http协议
GET请求 http://www.zhiliaowang.com/toupiaoceshi.asp?name=朱云翔
HTTP/1.1
Accept: */*
Accept-Language: zh-cn
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1; SV1; .NET CLR 2.0.50727)
Host: www.zhiliaowang.com
Connection: Keep-Alive
GET应答报文例子
一个请求URL为"http://www.zhiliaowang.com/toupiaoceshi.asp?name=朱云翔"的应答报文例子如下:
HTTP/1.1 200 OK
Connection: keep-alive
Date: Thu, 26 Jul 2007 14:00:02 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Content-Length: 190
Content-Type: text/html
Set-Cookie: ASPSESSIONIDSAATTCSQ=JOPPKDCAMHHBEOICJPGPBJOB; path=/
Cache-control: private
<html>
<head>
<title>精通Unix下C语言编程</title>
</head>
<body>
<b>精通Unix下C语言编程与项目实战<br></b>
<b>投票测试<br></b>
感谢你为选手
朱云翔
投票!
</body>
</html>
POST请求报文例子
POST /sp.cgi HTTP/1.0 /* 请求行,服务程序为sp.cgi */
Host: www.spserver.com /* 以下为实体头信息 */
Authorization: Basic <Base64 串>
Content-Length: <Content-Length>
<CommandId>=<4> /* 以下为POST请求的实体信息 */
<SequenceNumber>=<205502327125025327> /* 实体部分输送报文 */
<UserNumber>=<8613001125453>
<SPNumber>=<168>
<MessageContent>=<ABCD 1234>
POST应答报文例子
HTTP/1.0 200 OK /* 状态行,应答成功 */
Date: Tue, 13 Mar 2001 02:45:12 GMT /* 以下为实体头信息 */
Server: Apache/1.3.12 (Unix)
Content-Type: text/html
Connection: close
<CommandId>=<80000004> /* 以下为POST应答的实体信息 */<SequenceNumber>=<205502327125025327><UserNumber>=<8613001125453><SPNumber>=<168><MessageContent>=< EFGH 5678> <Result>=<0>
一般情况下,POST应答报文的"实体"部分存储实际传输的信息
联系客服