当浏览器发送了HTTP请求之后,服务器就会通过一个HTTP response来响应这个请求。http header请求完成之后,你的浏览器可能会收到如下的HTTP响应:
HTTP/1.x 200 OK
Transfer-Encoding: chunked
Date: Sat, 28 Nov 2009 04:36:25 GMT
Server: LiteSpeed
Connection: close
X-Powered-By: W3 Total Cache/0.8
Pragma: public
Expires: Sat, 28 Nov 2009 05:36:25 GMT
Etag: "pub1259380237;gz"
Cache-Control: max-age=3600, public
Content-Type: text/html; charset=UTF-8
Last-Modified: Sat, 28 Nov 2009 03:50:37 GMT
X-Pingback: http://net.tutsplus.com/xmlrpc.php
Content-Encoding: gzip
Vary: Accept-Encoding, Cookie, User-Agent
<!-- ... rest of the html ... -->
第一行呢被称为“Status Line”,它之后就是http headers,空行完了就开始输出内容了(在这个案例中是一些html输出)。
但你查看页面源代码却不能看到HTTP headers,虽然它们同你能看到的东西一起被传送至浏览器了。
第一个有价值的信息就是协议。目前服务器都会使用 HTTP/1.x 或者 HTTP/1.1。
接下来一个简短的信息代表状态。代码200意味着我们的请求已经发送成功了,服务器将会返回给我们所请求的文档,在头部信息之后。
general-header = Cache-Control
| Connection
| Date
| Pragma
| Trailer
| Transfer-Encoding
| Upgrade
| Via
| Warning
response-header = Accept-Ranges
| Age
| ETag
| Location
| Proxy-Authenticate
| Retry-After
| Server
| Vary
| WWW-Authenticate
Header |
解释 |
示例 |
Accept-Ranges |
表明服务器是否支持指定范围请求及哪种类型的分段请求 |
Accept-Ranges: bytes |
Age |
从原始服务器到代理缓存形成的估算时间(以秒计,非负) |
Age: 12 |
Cache-Control |
告诉所有的缓存机制是否可以缓存及哪种类型 |
Cache-Control: no-cache |
Date |
原始服务器消息发出的时间 |
Date: Tue, 15 Nov 2010 08:12:31 GMT |
ETag |
请求变量的实体标签的当前值 |
ETag: “737060cd8c284d8af7ad3082f209582d” |
Pragma |
包括实现特定的指令,它可应用到响应链上的任何接收方 |
Pragma: no-cache |
Proxy-Authenticate |
它指出认证方案和可应用到代理的该URL上的参数 |
Proxy-Authenticate: Basic |
Retry-After |
如果实体暂时不可取,通知客户端在指定时间之后再次尝试 |
Retry-After: 120 |
Server |
web服务器软件名称 |
Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) |
Trailer |
指出头域在分块传输编码的尾部存在 |
Trailer: Max-Forwards |
Transfer-Encoding |
文件传输编码 |
Transfer-Encoding:chunked |
Vary |
告诉下游代理是使用缓存响应还是从原始服务器请求 |
Vary: * |
Via |
告知代理客户端响应是通过哪里发送的 |
Via: 1.0 fred, 1.1 nowhere.com (Apache/1.1) |
Warning |
警告实体可能存在的问题 |
Warning: 199 Miscellaneous warning |
WWW-Authenticate |
表明客户端请求实体应该使用的授权方案 |
WWW-Authenticate: Basic |
Location |
用来重定向接收方到非请求URL的位置来完成请求或标识新的资源 |
Location: http://www.zcmhi.com/archives/94.html |
Upgrade |
向服务器指定某种传输协议以便服务器进行转换(如果支持) |
Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11 |
Connection |
表示是否需要持久连接。(HTTP 1.1默认进行持久连接) |
Connection: close |
相关推荐
6.1 Request and Response Header Fields 128 6.1.1 Alert-Info 128 6.1.2 Allow-Events 129 6.1.3 Call-ID 129 6.1.4 Contact 130 6.1.5 CSeq 132 6.1.6 Date 132 6.1.7 Encryption 133 6.1.8 From 133 6.1.9 ...
Adds a response header with the given name and date-value. addHeader(String, String) - Method in class javax.servlet.http.HttpServletResponseWrapper The default behavior of this method is to return ...
1 Introduction ...................................................7 1.1 Purpose....................................................... 6.2 Response Header Fields ......................................41
4.5 常用头域(General Header Fields) 5 请求(Request) 5.1 请求行 (Request-Line) 5.1.1方法 (Method) 5.1.2请求URL(Request-URI) 5.2请求资源 (The Resource Identified by a Request) 5.3请求报头域...
4.5 常用头域(General Header Fields) 35 5 请求 35 5.1 请求行 36 5.1.1方法 36 5.1.2请求URL(Request-URI) 37 5.2请求的资源 38 5.3请求报头域 39 6 响应 40 6.1 状态行 (Status-Line) 41 6.1.1状态码与...
first part proposes new guidelines for TCP’s response to ECN mechanisms(e.g.,Source Quench packets,ECN fields in packet headers).Next,using simulations,we explore the benefits and drawbacks of ECN in...
7241 Header Packet Flow Control and Error Recovery 7-15 72411 Initialization7-15 72412 General Rules of LGOOD_n and LCRD_x Usage7-18 72413 Transmitting Header Packets 7-18 72414 Receiving Header ...
'-------------------------------------------------------------------- ' Microsoft ADO ' ...' ' ' ' ADO constants include file for VBScript ' '------------------------------------------------------------...
http://php.net/configuration.file ; The syntax of the file is extremely simple. Whitespace and lines ; beginning with a semicolon are silently ignored (as you probably guessed). ; Section headers (e...
transport-layer segment: generated by the transport layer and encapsulates application-layer message with transport layer header; network-layer datagram: encapsulates transport-layer segment with a ...
14.5.3. Retrieving Validated Fields and other Reports 14.5.3.1. Querying if the input is valid 14.5.3.2. Getting Invalid, Missing, or Unknown Fields 14.5.3.3. Getting Valid Fields 14.5.4. Using ...
41. Showing a response count without showing the responses 89 42. 常用的几个按钮收集 91 43. 在WEB上从视图删除文档技巧 93 44. 在Domino Designer中使用XML数据 96 45. 在Domino Designer上执行XML 100 46. ...
41. Showing a response count without showing the responses 89 42. 常用的几个按钮收集 91 43. 在WEB上从视图删除文档技巧 93 44. 在Domino Designer中使用XML数据 96 45. 在Domino Designer上执行XML 100 46. ...
41. Showing a response count without showing the responses 89 42. 常用的几个按钮收集 91 43. 在WEB上从视图删除文档技巧 93 44. 在Domino Designer中使用XML数据 96 45. 在Domino Designer上执行XML 100 46. ...
41. Showing a response count without showing the responses 89 42. 常用的几个按钮收集 91 43. 在WEB上从视图删除文档技巧 93 44. 在Domino Designer中使用XML数据 96 45. 在Domino Designer上执行...
7.3 Header Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 7.3.1 Header FieldFormat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24...
Provisional Policy with New Header API Other API Changes ftplib functools gc hmac http html imaplib inspect io itertools logging math mmap multiprocessing nntplib os pdb pickle ...
It mostly contains the request information, ServletContext initialization parameters, ServetContext attributes, request headers, response headers etc. sendRedirect In JSP sendRedirect() method is a ...
This specification was developed in response to a perceived need for a standardized programming inter-face to digitizing tablets, three dimensional position sensors, and other pointing devices by a ...