HTTP 请求报头

1. Accept: 请求报头域用于指定客户端接受哪些类型的信息。

"Accept" ":" #( media-range [ accept-params ] )

如:text/*;q=0.3, text/html;q=0.7, text/html;level=1,

               text/html;level=2;q=0.4, */*;q=0.5

               

2. Accept-Charset:指定客户端接受的字符集

       "Accept-Charset" ":" 1#( ( charset | "*" )[ ";" "q" "=" qvalue ] )

    如:Accept-Charset: iso-8859-5, unicode-1-1;q=0.8

   

3. Accept-Encoding:指浏览器可以支持的web服务器返回内容编码类型          

    "Accept-Encoding" ":" 1#( codings [ ";" "q" "=" qvalue ] )

    如:Accept-Encoding: gzip;q=1.0, identity; q=0.5, *;q=0

   

4. Accept-Language:指定一种假设浏览器可接受的语言

    "Accept-Language" ":" 1#( language-range [ ";" "q" "=" qvalue ] )

    如:Accept-Language: da, en-gb;q=0.8, en;q=0.7

   

5. Accept-Ranges:可以请求网页实体的一个或者多个子范围字段

    "Accept-Ranges" ":" acceptable-ranges | none

    一般不建议携带此消息头

   

6. Authorization:HTTP授权的授权证书,返回401(未授权)时可以使用

    "Authorization" ":" credentials

    如:Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

   

7. Cache-Control:指定请求和响应遵循的缓存机制

    "Cache-Control" ":" 1#cache-directive

   

    cache-request-directive =

    "no-cache"                          ; Section 14.9.1

         | "no-store"                          ; Section 14.9.2

         | "max-age" "=" delta-seconds         ; Section 14.9.3, 14.9.4

         | "max-stale" [ "=" delta-seconds ]   ; Section 14.9.3

         | "min-fresh" "=" delta-seconds       ; Section 14.9.3

         | "no-transform"                      ; Section 14.9.5

         | "only-if-cached"                    ; Section 14.9.4

         | cache-extension                     ; Section 14.9.6

         

         cache-response-directive =

           "public"                               ; Section 14.9.1

         | "private" [ "=" <"> 1#field-name <"> ] ; Section 14.9.1

         | "no-cache" [ "=" <"> 1#field-name <"> ]; Section 14.9.1

         | "no-store"                             ; Section 14.9.2

         | "no-transform"                         ; Section 14.9.5

         | "must-revalidate"                      ; Section 14.9.4

         | "proxy-revalidate"                     ; Section 14.9.4

         | "max-age" "=" delta-seconds            ; Section 14.9.3

         | "s-maxage" "=" delta-seconds           ; Section 14.9.3

         | cache-extension                        ; Section 14.9.6

    

8. Connection:表示是否需要持久连接

"Connection" ":" 1#(connection-token)

默认持久连接。

9. Cookie: ...

10. Content-Length:请求的内容(message-body)长度

"Content-Length" ":" 1*DIGIT

不建议指定

11. Content-Type:请求的与实体对应的MIME信息

"Content-Type" ":" media-type

如: Content-Type: text/html; charset=utf-8

12. Date:请求发送的日期和时间

"Date" ":" HTTP-date

如:Date: Tue, 15 Nov 1994 08:12:31 GMT

13. Expect:请求的特定的服务器行为

"Expect" ":" 1#expectation

如:Expect: 100-continue

14. From:发出请求的用户的Email

"From" ":" mailbox

如:From: [email protected]

15. Host:指定请求的服务器的域名和端口号

"Host" ":" host [ ":" port ] ; 

如:Host: www.w3.org

16. If-Match:只有请求内容与实体相匹配才有效

"If-Match" ":" ( "*" | 1#entity-tag )

如:If-Match: "xyzzy"

17. If-Modified-Since:如果请求的部分在指定时间之后被修改则请求成功,未被修改则返回304

"If-Modified-Since" ":" HTTP-date

如:If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT

18. If-None-Match:如果内容未改变返回304代码,参数为服务器先前发送的Etag,与服务器回应

   的Etag比较判断是否改变

   "If-None-Match" ":" ( "*" | 1#entity-tag )

如:If-None-Match: "xyzzy"

19. If-Range:如果实体未改变,服务器发送客户端丢失的部分,否则发送整个实体。参数也为Etag

"If-Range" ":" ( entity-tag | HTTP-date )

如:If-Range: "xyzzy"

20. If-Unmodified-Since:只在实体在指定时间之后未被修改才请求成功

"If-Unmodified-Since" ":" HTTP-date

如:If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT

21. Max-Forwards:限制信息通过代理和网关传送的时间

"Max-Forwards" ":" 1*DIGIT

如:Max-Forwards: 10

22. Pragma:用来包含实现特定的指令

"Pragma" ":" 1#pragma-directive

如:Pragma: no-cache

23. Proxy-Authorization:连接到代理的授权证书

"Proxy-Authorization" ":" credentials

如:Proxy-Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

24. Range:只请求实体指定范围的部分

"Range" ":" ranges-specifier

如:Range: bytes=500-999

25. Referer:跳转至当前页面来的那个网页地址

"Referer" ":" ( absoluteURI | relativeURI )

Referer: http://www.w3.org/hypertext/DataSources/Overview.html

26. TE:客户端愿意接受的传输编码,并通知服务器接受接受尾加头信息

如:TE: trailers,deflate;q=0.5

27. Upgrade:向服务器指定某种传输协议以便服务器进行转换(如果支持)

"Upgrade" ":" 1#product

如:Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11

28. Via:通知中间网关或代理服务器地址,通信协议

"Via" ":" 1#( received-protocol received-by [ comment ] )

Via: 1.0 ricky, 1.1 mertz, 1.0 lucy

29. Warning:关于消息实体的警告信息

"Warning" ":" 1#warning-value

如:Warn: 199 Miscellaneous warning

30. User-Agent:包含发出请求的浏览器以及系统版本等信息

"User-Agent" ":" 1*( product | comment )

如:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36

  (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36

(注意:部分安全云盾可能会监测校验此内容)

猜你喜欢

转载自study121007.iteye.com/blog/2265615