1.请求静态网页
Client Request:
GET / HTTP/1.1
Host: 192.168.10.120:8000
Connection: keep-alive
Cache-Control: max-age=0
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.95 Safari/537.4
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: zh-CN,zh;q=0.8
Accept-Charset: GBK,utf-8;q=0.7,*;q=0.3
#########server回应
HTTP/1.0 200 OK
Server: SimpleHTTP/0.6 Python/2.7.3
Date: Mon, 13 May 2013 15:32:29 GMT
Content-type: text/html; charset=mbcs
Content-Length: 366
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html>
<title>Directory listing for /</title>
<body>
<h2>Directory listing for /</h2>
<hr>
<ul>
<li><a href="1.ps">1.ps</a>
<li><a href="2.wps">2.wps</a>
<li><a href="23_lan/">23_lan/</a>
<li><a href="3.txt">3.txt</a>
<li><a href="cvtest/">cvtest/</a>
<li><a href="test1/">test1/</a>
</ul>
<hr>
</body>
</html>
2.请求传输文件
GET /3.txt HTTP/1.1
Host: 192.168.10.120:8000
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.95 Safari/537.4
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Referer: http://192.168.10.120:8000/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: zh-CN,zh;q=0.8
Accept-Charset: GBK,utf-8;q=0.7,*;q=0.3
HTTP/1.0 200 OK
Server: SimpleHTTP/0.6 Python/2.7.3
Date: Mon, 13 May 2013 15:32:34 GMT
Content-type: text/plain
Content-Length: 516
Last-Modified: Mon, 13 May 2013 15:31:54 GMT
(1).................................................................................................(2)....................................................j.........................j............................................................................................................................ ..............................................................................................................................................................................................................[2]
3.传输404
GET /favicon.ico HTTP/1.1
Host: 192.168.10.120:8000
Connection: keep-alive
Accept: */*
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.95 Safari/537.4
Accept-Encoding: gzip,deflate,sdch
Accept-Language: zh-CN,zh;q=0.8
Accept-Charset: GBK,utf-8;q=0.7,*;q=0.3
HTTP/1.0 404 File not found
Server: SimpleHTTP/0.6 Python/2.7.3
Date: Mon, 13 May 2013 15:32:32 GMT
Content-Type: text/html
Connection: close
<head>
<title>Error response</title>
</head>
<body>
<h1>Error response</h1>
<p>Error code 404.
<p>Message: File not found.
<p>Error code explanation: 404 = Nothing matches the given URI.
</body>