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