HTTP请求的细节——消息头
用于HTTP请求中的常用头
Accept: text/html,image/*
Accept-Charset: ISO-8859-1
Accept-Encoding: gzip,compress
Accept-Language: en-us,zh-cn
Host: www.it315.org:80
If-Modified-Since: Tue, 11 Jul 2000 18:23:51 GMT
Referer: http://www.it315.org/index.jsp
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
Cookie
Connection: close/Keep-Alive
Date: Tue, 11 Jul 2000 18:23:51 GMT
HTTP响应
一个HTTP响应代表服务器向客户端回送的数据,它包括:
一个状态行、若干消息头、以及实体内容 。
举例:
HTTP/1.1 200 OK 状态行 状态行用于描述服务器
对请求的处理结果。
Server: Microsoft-IIS/5.0
Date: Thu, 13 Jul 2000 05:46:53 GMT
Content-Length: 2291
Content-Type: text/html 消息头用于描述服务器的基本信息,以及数据的描述,服务器通过这些数据的描述信息,可以通知客户端如何处理等一会儿它回送的数据。
Cache-control: private
<HTML>
<BODY>
……