Accept-Language: zh-CN
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
Host: localhost:8080
Content-Length: 10
Connection: Keep-Alive
Cache-Control: no-cache
//空白行信息::分隔响应头信息和响应体信息
name=fdghd //请求体信息
Accept-Language: zh-CN //通知服务器,浏览器可以接受的语言种类
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) //通知服务器,用户上网的代理软件是谁
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate //通知服务器,浏览器可接收的资源种类
Host: localhost:8080 //指定请求资源的主机名
Content-Length: 10
Connection: Keep-Alive
Cache-Control: no-cache
Server: Apache-Coyote/1.1 // 响应头信息
Accept-Ranges: bytes
ETag: W/"386-1362317486015"
Last-Modified: Sun, 03 Mar 2013 13:31:26 GMT
Content-Type: text/html
Content-Length: 386
Date: Sun, 03 Mar 2013 13:32:27 GMT
// 空白行信息
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> // 响应体信息
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<form action="" method="post">
Name:<input type="text" name="name"/>
<input type="submit" value="submit" />
</form>
</body>
</html>
常用的状态码:
200 响应成功
304 需要浏览器继续发送请求来细化原来的请求
404 资源不存在
500 服务器发生异常了
ETag: W/"425-1362322259204"
Last-Modified: Sun, 03 Mar 2013 14:50:59 GMT
Content-Type: text/html
Content-Length: 425
Date: Sun, 03 Mar 2013 14:51:57 GMT