用AI赚第一桶💰低成本搭建一套AI赚钱工具,源码可二开。 广告
# httpheader <div id="main_content"> <div id="left_content"> <div>HTTP Header 详解 <p>HTTP(HyperTextTransferProtocol) 即超文本传输协议,目前网页传输的的通用协议。HTTP协议采用了请求/响应模 型,浏览器或其他客户端发出请求,服务器给与响应。就整个网络资源传输而言,包括message-header和message-body两部分。首先传 递message-header,即<strong>http</strong> <strong>header</strong>消息<strong> 。</strong>http header 消息通常被分为4个部分:general&nbsp; header, request header, response header, entity header。但是这种分法就理解而言,感觉界限不太明确。根据维基百科对http header内容的组织形式,大体分为Request和Response两部分。</p> <h2 id="right_content">Requests部分</h2> </div> <div> <div class="contents_main"> <div id="ArticleCnt"> <table style="width: 958px; height: 1029px;" border="1" cellpadding="0"> <tbody> <tr><th>Header</th><th width="35%">解释</th><th style="text-align: left;" width="40%">示例</th></tr> <tr> <td><span style="font-size: 15px;">Accept</span></td> <td width="35%"><span style="font-size: 15px;">指定客户端能够接收的内容类型</span></td> <td width="40%"><span style="font-size: 15px;">Accept: text/plain, text/html</span></td> </tr> <tr> <td><span style="font-size: 15px;">Accept-Charset</span></td> <td width="35%"><span style="font-size: 15px;">浏览器可以接受的字符编码集。</span></td> <td width="40%"><span style="font-size: 15px;">Accept-Charset: iso-8859-5</span></td> </tr> <tr> <td><span style="font-size: 15px;">Accept-Encoding</span></td> <td width="35%"><span style="font-size: 15px;">指定浏览器可以支持的web服务器返回内容压缩编码类型。</span></td> <td width="40%"><span style="font-size: 15px;">Accept-Encoding: compress, gzip</span></td> </tr> <tr> <td><span style="font-size: 15px;">Accept-Language</span></td> <td width="35%"><span style="font-size: 15px;">浏览器可接受的语言</span></td> <td width="40%"><span style="font-size: 15px;">Accept-Language: en,zh</span></td> </tr> <tr> <td><span style="font-size: 15px;">Accept-Ranges</span></td> <td width="35%"><span style="font-size: 15px;">可以请求网页实体的一个或者多个子范围字段</span></td> <td width="40%"><span style="font-size: 15px;">Accept-Ranges: bytes</span></td> </tr> <tr> <td><span style="font-size: 15px;">Authorization</span></td> <td width="35%"><span style="font-size: 15px;">HTTP授权的授权证书</span></td> <td width="40%"><span style="font-size: 15px;">Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==</span></td> </tr> <tr> <td><span style="font-size: 15px;">Cache-Control</span></td> <td width="35%"><span style="font-size: 15px;">指定请求和响应遵循的缓存机制</span></td> <td width="40%"><span style="font-size: 15px;">Cache-Control: no-cache</span></td> </tr> <tr> <td><span style="font-size: 15px;">Connection</span></td> <td width="35%"><span style="font-size: 15px;">表示是否需要持久连接。(HTTP 1.1默认进行持久连接)</span></td> <td width="40%"><span style="font-size: 15px;">Connection: close</span></td> </tr> <tr> <td><span style="font-size: 15px;">Cookie</span></td> <td width="35%"><span style="font-size: 15px;">HTTP请求发送时,会把保存在该请求域名下的所有cookie值一起发送给web服务器。</span></td> <td width="40%"><span style="font-size: 15px;">Cookie: $Version=1; Skin=new;</span></td> </tr> <tr> <td><span style="font-size: 15px;">Content-Length</span></td> <td width="35%"><span style="font-size: 15px;">请求的内容长度</span></td> <td width="40%"><span style="font-size: 15px;">Content-Length: 348</span></td> </tr> <tr> <td><span style="font-size: 15px;">Content-Type</span></td> <td width="35%"><span style="font-size: 15px;">请求的与实体对应的MIME信息</span></td> <td width="40%"><span style="font-size: 15px;">Content-Type: application/x-www-form-urlencoded</span></td> </tr> <tr> <td><span style="font-size: 15px;">Date</span></td> <td width="35%"><span style="font-size: 15px;">请求发送的日期和时间</span></td> <td width="40%"><span style="font-size: 15px;">Date: Tue, 15 Nov&nbsp;2010 08:12:31 GMT</span></td> </tr> <tr> <td><span style="font-size: 15px;">Expect</span></td> <td width="35%"><span style="font-size: 15px;">请求的特定的服务器行为</span></td> <td width="40%"><span style="font-size: 15px;">Expect: 100-continue</span></td> </tr> <tr> <td><span style="font-size: 15px;">From</span></td> <td width="35%"><span style="font-size: 15px;">发出请求的用户的Email</span></td> <td width="40%"><span style="font-size: 15px;">From: user@email.com</span></td> </tr> <tr> <td><span style="font-size: 15px;">Host</span></td> <td width="35%"><span style="font-size: 15px;">指定请求的服务器的域名和端口号</span></td> <td width="40%"><span style="font-size: 15px;">Host: www.zcmhi.com</span></td> </tr> <tr> <td><span style="font-size: 15px;">If-Match</span></td> <td width="35%"><span style="font-size: 15px;">只有请求内容与实体相匹配才有效</span></td> <td width="40%"><span style="font-size: 15px;">If-Match: “737060cd8c284d8af7ad3082f209582d”</span></td> </tr> <tr> <td><span style="font-size: 15px;">If-Modified-Since</span></td> <td width="35%"><span style="font-size: 15px;">如果请求的部分在指定时间之后被修改则请求成功,未被修改则返回304代码</span></td> <td width="40%"><span style="font-size: 15px;">If-Modified-Since: Sat, 29 Oct 2010 19:43:31 GMT</span></td> </tr> <tr> <td><span style="font-size: 15px;">If-None-Match</span></td> <td width="35%"><span style="font-size: 15px;">如果内容未改变返回304代码,参数为服务器先前发送的Etag,与服务器回应的Etag比较判断是否改变</span></td> <td width="40%"><span style="font-size: 15px;">If-None-Match: “737060cd8c284d8af7ad3082f209582d”</span></td> </tr> <tr> <td><span style="font-size: 15px;">If-Range</span></td> <td width="35%"><span style="font-size: 15px;">如果实体未改变,服务器发送客户端丢失的部分,否则发送整个实体。参数也为Etag</span></td> <td width="40%"><span style="font-size: 15px;">If-Range: “737060cd8c284d8af7ad3082f209582d”</span></td> </tr> <tr> <td><span style="font-size: 15px;">If-Unmodified-Since</span></td> <td width="35%"><span style="font-size: 15px;">只在实体在指定时间之后未被修改才请求成功</span></td> <td width="40%"><span style="font-size: 15px;">If-Unmodified-Since: Sat, 29 Oct 2010 19:43:31 GMT</span></td> </tr> <tr> <td><span style="font-size: 15px;">Max-Forwards</span></td> <td width="35%"><span style="font-size: 15px;">限制信息通过代理和网关传送的时间</span></td> <td width="40%"><span style="font-size: 15px;">Max-Forwards: 10</span></td> </tr> <tr> <td><span style="font-size: 15px;">Pragma</span></td> <td width="35%"><span style="font-size: 15px;">用来包含实现特定的指令</span></td> <td width="40%"><span style="font-size: 15px;">Pragma: no-cache</span></td> </tr> <tr> <td><span style="font-size: 15px;">Proxy-Authorization</span></td> <td width="35%"><span style="font-size: 15px;">连接到代理的授权证书</span></td> <td width="40%"><span style="font-size: 15px;">Proxy-Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==</span></td> </tr> <tr> <td><span style="font-size: 15px;">Range</span></td> <td width="35%"><span style="font-size: 15px;">只请求实体的一部分,指定范围</span></td> <td width="40%"><span style="font-size: 15px;">Range: bytes=500-999</span></td> </tr> <tr> <td><span style="font-size: 15px;">Referer</span></td> <td width="35%"><span style="font-size: 15px;">先前网页的地址,当前请求网页紧随其后,即来路</span></td> <td width="40%"><span style="font-size: 15px;">Referer: http://www.zcmhi.com/archives/71.html</span></td> </tr> <tr> <td><span style="font-size: 15px;">TE</span></td> <td width="35%"><span style="font-size: 15px;">客户端愿意接受的传输编码,并通知服务器接受接受尾加头信息</span></td> <td width="40%"><span style="font-size: 15px;">TE: trailers,deflate;q=0.5</span></td> </tr> <tr> <td><span style="font-size: 15px;">Upgrade</span></td> <td width="35%"><span style="font-size: 15px;">向服务器指定某种传输协议以便服务器进行转换(如果支持)</span></td> <td width="40%"><span style="font-size: 15px;">Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11</span></td> </tr> <tr> <td><span style="font-size: 15px;">User-Agent</span></td> <td width="35%"><span style="font-size: 15px;">User-Agent的内容包含发出请求的用户信息</span></td> <td width="40%"><span style="font-size: 15px;">User-Agent: Mozilla/5.0 (Linux; X11)</span></td> </tr> <tr> <td><span style="font-size: 15px;">Via</span></td> <td width="35%"><span style="font-size: 15px;">通知中间网关或代理服务器地址,通信协议</span></td> <td width="40%"><span style="font-size: 15px;">Via: 1.0 fred, 1.1 nowhere.com (Apache/1.1)</span></td> </tr> <tr> <td><span style="font-size: 15px;">Warning</span></td> <td width="35%"><span style="font-size: 15px;">关于消息实体的警告信息</span></td> <td width="40%"><span style="font-size: 15px;">Warn: 199 Miscellaneous warning</span></td> </tr> </tbody> </table> <h2>Responses 部分<span id="more-94"> <br></span></h2> <table style="width: 993px; height: 906px;" border="1" cellpadding="0"> <tbody> <tr><th>Header</th><th width="35%">解释</th><th width="40%">示例</th> </tr> <tr> <td><span style="font-size: 15px;">Accept-Ranges</span></td> <td width="35%"><span style="font-size: 15px;">表明服务器是否支持指定范围请求及哪种类型的分段请求</span></td> <td width="40%"><span style="font-size: 15px;">Accept-Ranges: bytes</span></td> </tr> <tr> <td><span style="font-size: 15px;">Age</span></td> <td width="35%"><span style="font-size: 15px;">从原始服务器到代理缓存形成的估算时间(以秒计,非负)</span></td> <td width="40%"><span style="font-size: 15px;">Age: 12</span></td> </tr> <tr> <td><span style="font-size: 15px;">Allow</span></td> <td width="35%"><span style="font-size: 15px;">对某网络资源的有效的请求行为,不允许则返回405</span></td> <td width="40%"><span style="font-size: 15px;">Allow: GET, HEAD</span></td> </tr> <tr> <td><span style="font-size: 15px;">Cache-Control</span></td> <td width="35%"><span style="font-size: 15px;">告诉所有的缓存机制是否可以缓存及哪种类型</span></td> <td width="40%"><span style="font-size: 15px;">Cache-Control: no-cache</span></td> </tr> <tr> <td><span style="font-size: 15px;">Content-Encoding</span></td> <td width="35%"><span style="font-size: 15px;">web服务器支持的返回内容压缩编码类型。</span></td> <td width="40%"><span style="font-size: 15px;">Content-Encoding: gzip</span></td> </tr> <tr> <td><span style="font-size: 15px;">Content-Language</span></td> <td width="35%"><span style="font-size: 15px;">响应体的语言</span></td> <td width="40%"><span style="font-size: 15px;">Content-Language: en,zh</span></td> </tr> <tr> <td><span style="font-size: 15px;">Content-Length</span></td> <td width="35%"><span style="font-size: 15px;">响应体的长度</span></td> <td width="40%"><span style="font-size: 15px;">Content-Length: 348</span></td> </tr> <tr> <td><span style="font-size: 15px;">Content-Location</span></td> <td width="35%"><span style="font-size: 15px;">请求资源可替代的备用的另一地址</span></td> <td width="40%"><span style="font-size: 15px;">Content-Location: /index.htm</span></td> </tr> <tr> <td><span style="font-size: 15px;">Content-MD5</span></td> <td width="35%"><span style="font-size: 15px;">返回资源的MD5校验值</span></td> <td width="40%"><span style="font-size: 15px;">Content-MD5: Q2hlY2sgSW50ZWdyaXR5IQ==</span></td> </tr> <tr> <td><span style="font-size: 15px;">Content-Range</span></td> <td width="35%"><span style="font-size: 15px;">在整个返回体中本部分的字节位置</span></td> <td width="40%"><span style="font-size: 15px;">Content-Range: bytes 21010-47021/47022</span></td> </tr> <tr> <td><span style="font-size: 15px;">Content-Type</span></td> <td width="35%"><span style="font-size: 15px;">返回内容的MIME类型</span></td> <td width="40%"><span style="font-size: 15px;">Content-Type: text/html; charset=utf-8</span></td> </tr> <tr> <td><span style="font-size: 15px;">Date</span></td> <td width="35%"><span style="font-size: 15px;">原始服务器消息发出的时间</span></td> <td width="40%"><span style="font-size: 15px;">Date: Tue, 15 Nov 2010 08:12:31 GMT</span></td> </tr> <tr> <td><span style="font-size: 15px;">ETag</span></td> <td width="35%"><span style="font-size: 15px;">请求变量的实体标签的当前值</span></td> <td width="40%"><span style="font-size: 15px;">ETag: “737060cd8c284d8af7ad3082f209582d”</span></td> </tr> <tr> <td><span style="font-size: 15px;">Expires</span></td> <td width="35%"><span style="font-size: 15px;">响应过期的日期和时间</span></td> <td width="40%"><span style="font-size: 15px;">Expires: Thu, 01 Dec 2010 16:00:00 GMT</span></td> </tr> <tr> <td><span style="font-size: 15px;">Last-Modified</span></td> <td width="35%"><span style="font-size: 15px;">请求资源的最后修改时间</span></td> <td width="40%"><span style="font-size: 15px;">Last-Modified: Tue, 15 Nov 2010 12:45:26 GMT</span></td> </tr> <tr> <td><span style="font-size: 15px;">Location</span></td> <td width="35%"><span style="font-size: 15px;">用来重定向接收方到非请求URL的位置来完成请求或标识新的资源</span></td> <td width="40%"><span style="font-size: 15px;">Location: http://www.zcmhi.com/archives/94.html</span></td> </tr> <tr> <td><span style="font-size: 15px;">Pragma</span></td> <td width="35%"><span style="font-size: 15px;">包括实现特定的指令,它可应用到响应链上的任何接收方</span></td> <td width="40%"><span style="font-size: 15px;">Pragma: no-cache</span></td> </tr> <tr> <td><span style="font-size: 15px;">Proxy-Authenticate</span></td> <td width="35%"><span style="font-size: 15px;">它指出认证方案和可应用到代理的该URL上的参数</span></td> <td width="40%"><span style="font-size: 15px;">Proxy-Authenticate: Basic</span></td> </tr> <tr> <td><span style="font-size: 15px;">refresh</span></td> <td width="35%"><span style="font-size: 15px;">应用于重定向或一个新的资源被创造,在5秒之后重定向(由网景提出,被大部分浏览器支持)</span></td> <td width="40%"> <div><span style="font-family: monospace; font-size: 15px;">&nbsp;</span></div> <p><span style="font-family: monospace; font-size: 15px;">&nbsp;</span></p> <div id="_mcePaste"><span style="font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif; font-size: 15px;">Refresh: 5; url=</span></div> <div><span style="font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif; font-size: 15px;">http://www.zcmhi.com/archives/94.html</span></div> </td> </tr> <tr> <td><span style="font-size: 15px;">Retry-After</span></td> <td width="35%"><span style="font-size: 15px;">如果实体暂时不可取,通知客户端在指定时间之后再次尝试</span></td> <td width="40%"><span style="font-size: 15px;">Retry-After: 120</span></td> </tr> <tr> <td><span style="font-size: 15px;">Server</span></td> <td width="35%"><span style="font-size: 15px;">web服务器软件名称</span></td> <td width="40%"><span style="font-size: 15px;">Server: Apache/1.3.27 (Unix) (Red-Hat/Linux)</span></td> </tr> <tr> <td><span style="font-size: 15px;">Set-Cookie</span></td> <td width="35%"><span style="font-size: 15px;">设置Http Cookie</span></td> <td width="40%"><span style="font-size: 15px;">Set-Cookie: UserID=JohnDoe; Max-Age=3600; Version=1</span></td> </tr> <tr> <td><span style="font-size: 15px;">Trailer</span></td> <td width="35%"><span style="font-size: 15px;">指出头域在分块传输编码的尾部存在</span></td> <td width="40%"><span style="font-size: 15px;">Trailer: Max-Forwards</span></td> </tr> <tr> <td><span style="font-size: 15px;">Transfer-Encoding</span></td> <td width="35%"><span style="font-size: 15px;">文件传输编码</span></td> <td width="40%"><span style="font-family: monospace; font-size: 15px;"><span style="font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif;">Transfer-Encoding:chunked</span></span></td> </tr> <tr> <td><span style="font-size: 15px;">Vary</span></td> <td width="35%"><span style="font-size: 15px;">告诉下游代理是使用缓存响应还是从原始服务器请求</span></td> <td width="40%"><span style="font-size: 15px;">Vary: *</span></td> </tr> <tr> <td><span style="font-size: 15px;">Via</span></td> <td width="35%"><span style="font-size: 15px;">告知代理客户端响应是通过哪里发送的</span></td> <td width="40%"><span style="font-size: 15px;">Via: 1.0 fred, 1.1 nowhere.com (Apache/1.1)</span></td> </tr> <tr> <td><span style="font-size: 15px;">Warning</span></td> <td width="35%"><span style="font-size: 15px;">警告实体可能存在的问题</span></td> <td width="40%"><span style="font-size: 15px;">Warning: 199 Miscellaneous warning</span></td> </tr> <tr> <td><span style="font-size: 15px;">WWW-Authenticate</span></td> <td width="35%"><span style="font-size: 15px;">表明客户端请求实体应该使用的授权方案</span></td> <td width="40%"><span style="font-size: 15px;">WWW-Authenticate: Basic</span></td> </tr>