HTTP HEADER 格式

来源:互联网 发布:知乎周刊在线阅读 编辑:程序博客网 时间:2024/06/07 02:59
HTTP HEADER 格式

HTTP Request Header
<request-line>
<headers>
<blank line>
[<request-body>]

实例:
// <request-line>
GET / HTTP1.1
// <headers>
Host    127.0.0.1
User-Agent    Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.5) Gecko/20070713 Firefox/2.0.0.5
Accept    text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language    zh-cn,en-us;q=0.7,en;q=0.3
Accept-Encoding    gzip,deflate
Accept-Charset    ISO-2022-CN,utf-8;q=0.7,*;q=0.7
Keep-Alive    300
Connection    keep-alive
Referer    http://127.0.0.1/zXmlTest/zxmlTest.html
X-lori-time-1    1185893347015
If-Modified-Since    Tue, 31 Jul 2007 14:30:52 GMT
If-None-Match    "5cfb1fe0-b-e6c1f00"
Cache-Control    max-age=0
// <blank line>

// [<request-body>]

HTTP Response Header
<status-line>
<headers>
<blank line>
[<response-body>]

实例:
// <status-line>
HTTP1.1 200 OK
// <headers>
Date    Tue, 31 Jul 2007 14:49:07 GMT
Server    Apache/2.2.4 (Win32) PHP/5.2.1
Connection    Keep-Alive
Keep-Alive    timeout=5, max=98
Etag    "5cfb1fe0-b-e6c1f00"
// <blank line>

// [<response-body>]
ajax Text

附:HTTP  Response Status
200 一切正常
304 资源没有修改,可以使用缓存内容
401 需要密码授权
403 禁止访问
404 资源未找到
原创粉丝点击