aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/http/headers/index.html
blob: e23e0b0ac66fb98542576c335d9cd85f20f9bcf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
---
title: HTTP Headers
slug: Web/HTTP/Headers
tags:
  - HTTP Headers
translation_of: Web/HTTP/Headers
---
<p>{{ HTTPSidebar }}</p>

<p><strong>HTTP 消息头</strong>允许客户端和服务器通过<strong> request</strong><strong> response</strong>传递附加信息。一个请求头由名称(不区分大小写)后跟一个冒号“:”,冒号后跟具体的值(不带换行符)组成。该值前面的引导空白会被忽略。</p>

<p>自定专用消息头可通过'X-' 前缀来添加;但是这种用法被IETF在2012年6月发布的 <a href="https://tools.ietf.org/html/rfc6648">RFC6648</a> 中明确弃用,原因是其会在非标准字段成为标准时造成不便;其他的消息头在 <a class="external" href="http://www.iana.org/assignments/message-headers/perm-headers.html" title="http://www.iana.org/assignments/message-headers/perm-headers.html">IANA 注册表</a> 中列出, 其原始内容在 <a class="external" href="http://tools.ietf.org/html/rfc4229" title="http://tools.ietf.org/html/rfc4229">RFC 4229</a> 中定义。 此外,IANA 还维护着<a class="external" href="http://www.iana.org/assignments/message-headers/prov-headers.html">被提议的新HTTP 消息头注册表</a>.</p>

<p>根据不同上下文,可将消息头分为:</p>

<ul>
 <li>{{Glossary("General header", "General headers")}}: 同时适用于请求和响应消息,但与最终消息主体中传输的数据无关的消息头。</li>
 <li>{{Glossary("Request header", "Request headers")}}: 包含更多有关要获取的资源或客户端本身信息的消息头。</li>
 <li>{{Glossary("Response header", "Response headers")}}: 包含有关响应的补充信息,如其位置或服务器本身(名称和版本等)的消息头。</li>
 <li>{{Glossary("Entity header", "Entity headers")}}: 包含有关实体主体的更多信息,比如主体长(Content-Length)度或其MIME类型。</li>
</ul>

<p>消息头也可以根据代理对其的处理方式分为:</p>

<p><strong>端到端消息头</strong></p>

<p>这类消息头必须被传输到最终的消息接收者,也即,请求的服务器或响应的客户端。中间的代理服务器必须转发未经修改的端到端消息头,并且必须缓存它们。</p>

<p><strong>逐跳消息头</strong></p>

<p>这类消息头仅对单次传输连接有意义,不能通过代理或缓存进行重新转发。这些消息头包括 {{ httpheader("Connection") }}, {{ httpheader("Keep-Alive") }}, {{ httpheader("Proxy-Authenticate") }}, {{ httpheader("Proxy-Authorization") }}, {{ httpheader("TE") }}, {{ httpheader("Trailer") }}, {{ httpheader("Transfer-Encoding") }} 及 {{ httpheader("Upgrade") }}。注意,只能使用 {{ httpheader("Connection") }} 来设置逐跳一般头。</p>

<p>左侧导航栏提供了按字母顺序排列的列表。以下列清单概括了消息头及其用途:</p>

<table class="standard-table" style="width: 100%;">
 <tbody>
  <tr>
   <th>消息头</th>
   <th>描述</th>
   <th>更多信息</th>
   <th>标准</th>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Content_negotiation#The_Accept.3a_header" title="https://developer.mozilla.org/en/HTTP/Content_negotiation#The_Accept.3a_header">Accept</a></code></td>
   <td>用户代理期望的MIME 类型列表</td>
   <td><a href="/en-US/docs/Web/HTTP/Content_negotiation" title="en/HTTP/Content negotiation">HTTP Content Negotiation</a></td>
   <td>HTTP/1.1</td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Content_negotiation#The_Accept-CH_header">Accept-CH</a></code>
    <p>{{non-standard_inline}}</p>
   </td>
   <td>列出配置数据,服务器可据此来选择适当的响应。</td>
   <td><a href="http://igrigorik.github.io/http-client-hints">HTTP Client Hints</a></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Content_negotiation#The_Accept-Charset.3a_header" title="https://developer.mozilla.org/en/HTTP/Content_negotiation#The_Accept-Charset.3a_header">Accept-Charset</a></code></td>
   <td>列出用户代理支持的字符集。</td>
   <td><a href="/en-US/docs/Web/HTTP/Content_negotiation" title="en/HTTP/Content negotiation">HTTP Content Negotiation</a></td>
   <td>HTTP/1.1</td>
  </tr>
  <tr>
   <td><code>Accept-Features</code></td>
   <td></td>
   <td><a href="/en-US/docs/Web/HTTP/Content_negotiation" title="en/HTTP/Content negotiation">HTTP Content Negotiation</a></td>
   <td>RFC 2295, §8.2</td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Content_negotiation#The_Accept-Encoding.3a_header" title="https://developer.mozilla.org/en/HTTP/Content_negotiation#The_Accept-Encoding.3a_header">Accept-Encoding</a></code></td>
   <td>列出用户代理支持的压缩方法。</td>
   <td><a href="/en-US/docs/Web/HTTP/Content_negotiation" title="en/HTTP/Content negotiation">HTTP Content Negotiation</a></td>
   <td>HTTP/1.1</td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Content_negotiation#The_Accept-Language.3a_header" title="https://developer.mozilla.org/en/HTTP/Content_negotiation#The_Accept-Language.3a_header">Accept-Language</a></code></td>
   <td>列出用户代理期望的页面语言。</td>
   <td><a href="/en-US/docs/Web/HTTP/Content_negotiation" title="https://developer.mozilla.org/en/Content_negotiation">HTTP Content Negotiation</a></td>
   <td>HTTP/1.1</td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Accept-Ranges" title="en/Accept-Ranges">Accept-Ranges</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/HTTP_access_control#Access-Control-Allow-Credentials" title="https://developer.mozilla.org/En/HTTP_access_control#Access-Control-Allow-Credentials">Access-Control-Allow-Credentials</a></code></td>
   <td></td>
   <td><a href="/en-US/docs/HTTP_access_control" title="En/HTTP access control">HTTP Access Control</a> and <a href="/en-US/docs/Server-Side_Access_Control" title="En/Server-Side Access Control">Server Side Access Control</a>{{ gecko_minversion_inline("1.9.1") }}</td>
   <td><a class="external" href="http://www.w3.org/TR/cors/">W3C Cross-Origin Resource Sharing</a></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/HTTP_access_control#Access-Control-Allow-Origin" title="https://developer.mozilla.org/En/HTTP_access_control#Access-Control-Allow-Origin">Access-Control-Allow-Origin</a></code></td>
   <td></td>
   <td><a href="/en-US/docs/HTTP_access_control" title="En/HTTP access control">HTTP Access Control</a> and <a href="/en-US/docs/Server-Side_Access_Control" title="En/Server-Side Access Control">Server Side Access Control</a>{{ gecko_minversion_inline("1.9.1") }}</td>
   <td><a class="external" href="http://www.w3.org/TR/cors/">W3C Cross-Origin Resource Sharing</a></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/HTTP_access_control#Access-Control-Allow-Methods" title="https://developer.mozilla.org/En/HTTP_access_control#Access-Control-Allow-Methods">Access-Control-Allow-Methods</a></code></td>
   <td></td>
   <td><a href="/en-US/docs/HTTP_access_control" title="En/HTTP access control">HTTP Access Control</a> and <a href="/en-US/docs/Server-Side_Access_Control" title="En/Server-Side Access Control">Server Side Access Control</a>{{ gecko_minversion_inline("1.9.1") }}</td>
   <td><a class="external" href="http://www.w3.org/TR/cors/">W3C Cross-Origin Resource Sharing</a></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/HTTP_access_control#Access-Control-Allow-Headers" title="https://developer.mozilla.org/En/HTTP_access_control#Access-Control-Allow-Headers">Access-Control-Allow-Headers</a></code></td>
   <td></td>
   <td><a href="/en-US/docs/HTTP_access_control" title="En/HTTP access control">HTTP Access Control</a> and <a href="/en-US/docs/Server-Side_Access_Control" title="En/Server-Side Access Control">Server Side Access Control</a>{{ gecko_minversion_inline("1.9.1") }}</td>
   <td><a class="external" href="http://www.w3.org/TR/cors/">W3C Cross-Origin Resource Sharing</a></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/HTTP_access_control#Access-Control-Max-Age" title="https://developer.mozilla.org/En/HTTP_access_control#Access-Control-Max-Age">Access-Control-Max-Age</a></code></td>
   <td></td>
   <td><a href="/en-US/docs/HTTP_access_control" title="En/HTTP access control">HTTP Access Control</a> and <a href="/en-US/docs/Server-Side_Access_Control" title="En/Server-Side Access Control">Server Side Access Control</a>{{ gecko_minversion_inline("1.9.1") }}</td>
   <td><a class="external" href="http://www.w3.org/TR/cors/">W3C Cross-Origin Resource Sharing</a></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/HTTP_access_control#Access-Control-Expose-Header" title="en/HTTP access control#Access-Control-Expose-Header">Access-Control-Expose-Headers</a></code></td>
   <td></td>
   <td><a href="/en-US/docs/HTTP_access_control" title="En/HTTP access control">HTTP Access Control</a> and <a href="/en-US/docs/Server-Side_Access_Control" title="En/Server-Side Access Control">Server Side Access Control</a>{{ gecko_minversion_inline("2") }}</td>
   <td><a class="external" href="http://www.w3.org/TR/cors/">W3C Cross-Origin Resource Sharing</a></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/HTTP_access_control#Access-Control-Request-Method" title="https://developer.mozilla.org/En/HTTP_access_control#Access-Control-Request-Method">Access-Control-Request-Method</a></code></td>
   <td></td>
   <td><a href="/en-US/docs/HTTP_access_control" title="En/HTTP access control">HTTP Access Control</a> and <a href="/en-US/docs/Server-Side_Access_Control" title="En/Server-Side Access Control">Server Side Access Control</a>{{ gecko_minversion_inline("1.9.1") }}</td>
   <td><a class="external" href="http://www.w3.org/TR/cors/">W3C Cross-Origin Resource Sharing</a></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/HTTP_access_control#Access-Control-Request-Headers" title="https://developer.mozilla.org/En/HTTP_access_control#Access-Control-Request-Headers">Access-Control-Request-Headers</a></code></td>
   <td></td>
   <td><a href="/en-US/docs/HTTP_access_control" title="En/HTTP access control">HTTP Access Control</a> and <a href="/en-US/docs/Server-Side_Access_Control" title="En/Server-Side Access Control">Server Side Access Control</a>{{ gecko_minversion_inline("1.9.1") }}</td>
   <td><a class="external" href="http://www.w3.org/TR/cors/">W3C Cross-Origin Resource Sharing</a></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Age" title="en/Age">Age</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Allow" title="en/Allow">Allow</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code>Alternates</code></td>
   <td></td>
   <td><a href="/en-US/docs/Web/HTTP/Content_negotiation" title="en/HTTP/Content negotiation">HTTP Content Negotiation</a></td>
   <td>RFC 2295, §8.3</td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Authorization" title="en/Authorization">Authorization</a></code></td>
   <td>包含用服务器验证用户代理的凭证</td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Cache-Control" title="en/Cache-Control">Cache-Control</a></code></td>
   <td></td>
   <td><a href="/en-US/docs/HTTP_Caching_FAQ" title="en/HTTP Caching FAQ">HTTP Caching FAQ</a></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Connection" title="en/Connection">Connection</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Content-Encoding" title="en/Content-Encoding">Content-Encoding</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Content-Language" title="en/Content-Language">Content-Language</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Content-Length" title="en/Content-Length">Content-Length</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Content-Location" title="en/Content-Location">Content-Location</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Content-MD5" title="en/Content-MD5">Content-MD5</a></code></td>
   <td></td>
   <td>{{ unimplemented_inline("232030") }}</td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Content-Range" title="en/Content-Range">Content-Range</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Content-Security-Policy" title="en/Content-Security-Policy">Content-Security-Policy</a></code></td>
   <td>控制用户代理在一个页面上可以加载使用的资源。</td>
   <td><a href="/en/Security/CSP">CSP (Content Security Policy)</a></td>
   <td><a href="http://www.w3.org/TR/CSP2/">W3C Content Security Policy</a></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Content-Type" title="en/Content-Type">Content-Type</a></code></td>
   <td>指示服务器文档的MIME 类型。帮助用户代理(浏览器)去处理接收到的数据。</td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Cookie" title="en/Cookie">Cookie</a></code></td>
   <td></td>
   <td></td>
   <td><a class="external" href="http://www.ietf.org/rfc/rfc2109.txt">RFC 2109</a></td>
  </tr>
  <tr>
   <td><code>DNT</code></td>
   <td>设置该值为1, 表明用户明确退出任何形式的网上跟踪。</td>
   <td>Supported by Firefox 4, Firefox 5 for mobile, IE9, and a few major companies.</td>
   <td>{{SpecName("Tracking")}}</td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Date" title="en/Date">Date</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/ETag" title="en/ETag">ETag</a></code></td>
   <td></td>
   <td><a href="/en-US/docs/HTTP_Caching_FAQ" title="en/HTTP Caching FAQ">HTTP Caching FAQ</a></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Expect" title="en/Expect">Expect</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Expires" title="en/Expires">Expires</a></code></td>
   <td></td>
   <td><a href="/en-US/docs/HTTP_Caching_FAQ" title="en/HTTP Caching FAQ">HTTP Caching FAQ</a></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/From" title="en/From">From</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Host" title="en/Host">Host</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/If-Match" title="en/If-Match">If-Match</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/If-Modified-Since" title="en/If-Modified-Since">If-Modified-Since</a></code></td>
   <td></td>
   <td><a href="/en-US/docs/HTTP_Caching_FAQ" title="en/HTTP Caching FAQ">HTTP Caching FAQ</a></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/If-None-Match" title="en/If-None-Match">If-None-Match</a></code></td>
   <td></td>
   <td><a href="/en-US/docs/HTTP_Caching_FAQ" title="en/HTTP Caching FAQ">HTTP Caching FAQ</a></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/If-Range" title="en/If-Range">If-Range</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/If-Unmodified-Since" title="en/If-Unmodified-Since">If-Unmodified-Since</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Last-Event-ID" title="en/Last-Event-ID">Last-Event-ID</a></code></td>
   <td>给出服务器在先前HTTP连接上接收的最后事件的ID。用于同步文本/事件流。</td>
   <td><a href="/en-US/docs/Server-sent_events" title="en/Server-Sent Events">Server-Sent Events</a></td>
   <td><a class="external" href="http://dev.w3.org/html5/eventsource/">Server-Sent Events spec</a></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Last-Modified" title="en/Last-Modified">Last-Modified</a></code></td>
   <td></td>
   <td><a href="/en-US/docs/HTTP_Caching_FAQ" title="en/HTTP Caching FAQ">HTTP Caching FAQ</a></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Link" title="en/HTTP/Headers/Link">Link</a></code></td>
   <td>
    <p>等同于HTML标签中的"link",但它是在HTTP层上,给出一个与获取的资源相关的URL以及关系的种类。</p>
   </td>
   <td>
    <p>For the <code>rel=prefetch</code> case, see <a href="/en-US/docs/Link_prefetching_FAQ" title="en/Link prefetching FAQ">Link Prefetching FAQ</a></p>
   </td>
   <td>
    <p>Introduced in <a class="external" href="http://tools.ietf.org/html/rfc2068#section-19.6.2.4" title="http://tools.ietf.org/html/rfc2068#section-19.6.2.4">HTTP 1.1's RFC 2068, section 19.6.2.4</a>, it was removed in the final <a class="external" href="http://www.w3.org/Protocols/rfc2616/rfc2616.html">HTTP 1.1 spec</a>, then reintroduced, with some extensions, in <a class="external" href="http://greenbytes.de/tech/webdav/rfc5988.html">RFC 5988</a></p>
   </td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Location" title="en/Location">Location</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Max-Forwards" title="en/Max-Forwards">Max-Forwards</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code>Negotiate</code></td>
   <td></td>
   <td><a href="/en-US/docs/Web/HTTP/Content_negotiation" title="en/HTTP/Content negotiation">HTTP Content Negotiation</a></td>
   <td>RFC 2295, §8.4</td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/HTTP_access_control#Origin" title="https://developer.mozilla.org/En/HTTP_access_control#Origin">Origin</a></code></td>
   <td></td>
   <td><a href="/en-US/docs/HTTP_access_control" title="En/HTTP access control">HTTP Access Control</a> and <a href="/en-US/docs/Server-Side_Access_Control" title="En/Server-Side Access Control">Server Side Access Control</a>{{ gecko_minversion_inline("1.9.1") }}</td>
   <td>More recently defined in the <a href="https://fetch.spec.whatwg.org/#http-extensions">Fetch spec</a> (see <a href="/en-US/docs/Web/API/Fetch_API">Fetch API</a>.) Originally defined in <a class="external" href="http://www.w3.org/TR/cors/">W3C Cross-Origin Resource Sharing</a></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Pragma" title="en/Pragma">Pragma</a></code></td>
   <td></td>
   <td>for the pragma: nocache value see <a href="/en-US/docs/HTTP_Caching_FAQ" title="en/HTTP Caching FAQ">HTTP Caching FAQ</a></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Proxy-Authenticate" title="en/Proxy-Authenticate">Proxy-Authenticate</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Proxy-Authorization" title="en/Proxy-Authorization">Proxy-Authorization</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Range" title="en/Range">Range</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Referer" title="en/Referer">Referer</a></code></td>
   <td>
    <p>(请注意,在HTTP / 0.9规范中引入的正交错误必须在协议的后续版本中保留)</p>
   </td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Retry-After" title="en/Retry-After">Retry-After</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code>Sec-Websocket-Extensions</code></td>
   <td></td>
   <td></td>
   <td> <a class="external" href="http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-07">Websockets</a></td>
  </tr>
  <tr>
   <td><code>Sec-Websocket-Key</code></td>
   <td></td>
   <td></td>
   <td> <a class="external" href="http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-07">Websockets</a></td>
  </tr>
  <tr>
   <td><code>Sec-Websocket-Origin</code></td>
   <td></td>
   <td></td>
   <td> <a class="external" href="http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-07">Websockets</a></td>
  </tr>
  <tr>
   <td><code>Sec-Websocket-Protocol</code></td>
   <td></td>
   <td></td>
   <td> <a class="external" href="http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-07">Websockets</a></td>
  </tr>
  <tr>
   <td><code>Sec-Websocket-Version</code></td>
   <td></td>
   <td></td>
   <td> <a class="external" href="http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-07">Websockets</a></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Server" title="en/Server">Server</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Set-Cookie" title="en/Set-Cookie">Set-Cookie</a></code></td>
   <td></td>
   <td></td>
   <td><a class="external" href="http://www.ietf.org/rfc/rfc2109.txt">RFC 2109</a></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Set-Cookie2" title="en/Set-Cookie2">Set-Cookie2</a></code></td>
   <td></td>
   <td></td>
   <td><a class="external" href="http://www.ietf.org/rfc/rfc2965.txt">RFC 2965</a></td>
  </tr>
  <tr>
   <td><code>Strict-Transport-Security</code></td>
   <td></td>
   <td><a href="/en-US/docs/Security/HTTP_Strict_Transport_Security" title="en/Security/HTTP Strict Transport Security">HTTP Strict Transport Security</a></td>
   <td><a class="external" href="http://tools.ietf.org/html/draft-hodges-strict-transport-sec-02">IETF reference</a></td>
  </tr>
  <tr>
   <td><code>TCN</code></td>
   <td></td>
   <td><a href="/en-US/docs/Web/HTTP/Content_negotiation" title="en/HTTP/Content negotiation">HTTP Content Negotiation</a></td>
   <td>RFC 2295, §8.5</td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/TE" title="en/TE">TE</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Trailer" title="en/Trailer">Trailer</a></code></td>
   <td>
    <p>列出将在消息正文之后在尾部块中传输的头。这允许服务器计算一些值,如Content-MD5:在传输数据时。请注意,Trailer:标头不得列出Content-Length :, Trailer:或Transfer-Encoding:headers。</p>
   </td>
   <td></td>
   <td><a class="external" href="http://tools.ietf.org/html/rfc2616#section-14.40">RFC 2616, §14.40</a></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Transfer-Encoding" title="en/Transfer-Encoding">Transfer-Encoding</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Upgrade" title="en/Upgrade">Upgrade</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Content_negotiation#The_User-Agent.3a_header" title="https://developer.mozilla.org/en/HTTP/Content_negotiation#The_User-Agent.3a_header">User-Agent</a></code></td>
   <td></td>
   <td>for Gecko's user agents see the <a href="/en-US/docs/User_Agent_Strings_Reference" title="En/User Agent Strings Reference">User Agents Reference</a></td>
   <td></td>
  </tr>
  <tr>
   <td><code>Variant-Vary</code></td>
   <td></td>
   <td><a href="/en-US/docs/Web/HTTP/Content_negotiation" title="en/HTTP/Content negotiation">HTTP Content Negotiation</a></td>
   <td>RFC 2295, §8.6</td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Content_negotiation#The_Vary.3a_response_header" title="https://developer.mozilla.org/en/HTTP/Content_negotiation#The_Vary.3a_response_header">Vary</a></code></td>
   <td>
    <p>列出了用作Web服务器选择特定内容的条件的标头。此服务器对于高效和正确缓存发送的资源很重要。</p>
   </td>
   <td><a href="/en-US/docs/Web/HTTP/Content_negotiation" title="https://developer.mozilla.org/en/Content_negotiation">HTTP Content Negotiation</a> &amp; <a href="/en-US/docs/HTTP_Caching_FAQ" title="en/HTTP Caching FAQ">HTTP Caching FAQ</a></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Via" title="en/Via">Via</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/Warning" title="en/Warning">Warning</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code><a href="/en-US/docs/Web/HTTP/Headers/WWW-Authenticate" title="en/WWW-Authenticate">WWW-Authenticate</a></code></td>
   <td></td>
   <td></td>
   <td></td>
  </tr>
  <tr>
   <td><code>X-Content-Duration</code></td>
   <td></td>
   <td><a href="/en-US/docs/Configuring_servers_for_Ogg_media" title="https://developer.mozilla.org/en/Configuring_servers_for_Ogg_media">Configuring servers for Ogg media</a></td>
   <td></td>
  </tr>
  <tr>
   <td><code>X-Content-Security-Policy</code></td>
   <td></td>
   <td>Using <a href="/en-US/docs/Security/CSP/Using_Content_Security_Policy" title="en/Security/CSP/Using Content Security Policy">Content Security Policy</a></td>
   <td></td>
  </tr>
  <tr>
   <td><code>X-DNSPrefetch-Control</code></td>
   <td></td>
   <td><a href="/en-US/docs/Controlling_DNS_prefetching" title="En/Controlling DNS prefetching">Controlling DNS prefetching</a></td>
   <td></td>
  </tr>
  <tr>
   <td><code>X-Frame-Options</code></td>
   <td></td>
   <td><a href="/en-US/docs/The_X-FRAME-OPTIONS_response_header" title="en/The X-FRAME-OPTIONS response header">The XFrame-Option Response Header</a></td>
   <td></td>
  </tr>
  <tr>
   <td><code>X-Requested-With</code></td>
   <td>
    <p>通常在值为“XMLHttpRequest”时使用</p>
   </td>
   <td></td>
   <td>Not standard</td>
  </tr>
 </tbody>
</table>

<h2 id="注意">注意</h2>

<div class="note">
<p><strong>注意:</strong>{{Gecko ("5.0") }}不会发送带有Keep-Alive的请求头。以前的版本确实发送过,但格式并不正确,因此决定暂时删除它。{{ httpheader("Connection") }}{{ httpheader("Proxy-Connection") }}报文首部仍然会发送,带着"keep-alive"的值。</p>
</div>

<h2 id="更多">更多</h2>

<p><a href="http://en.wikipedia.org/wiki/List_of_HTTP_header_fields">维基百科上对HTTP首部的展示</a></p>