Http请求
GET /day09/first HTTP/1.1 –请求行(必须有)
Host: localhost:8080 –多个请求头(必须有)
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language: zh-cn,en-us;q=0.8,zh;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Connection: keep-alive
–一个空行
name=eric&password=123456 –请求实体内容(可选)
多个请求头
Accept: text/html,image/* –浏览器接收的数据类型
Accept-Charset: ISO-8859-1 –浏览器接收的编码格式
Accept-Encoding: gzip,compress –浏览器接收的数据压缩格式
Accept-Language: en-us,zh- –浏览器接收的语言
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: name=eric —浏览器保存的cookie信息
Connection: close/Keep-Alive –浏览器和服务器连接状态。close:关闭连接。keep-alive:保持连接。
Date: Tue, 11 Jul 2000 18:23:51 GMT –请求发出时间