blob: 9f087cd21dbe0de261612ae2a87bccbc9c6f3a39 (
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
|
---
title: Allow
slug: Web/HTTP/Headers/Allow
translation_of: Web/HTTP/Headers/Allow
---
<div>{{HTTPSidebar}}</div>
<p><code><strong>Allow</strong></code> 首部字段用于枚举资源所支持的 HTTP 方法的集合。</p>
<p>若服务器返回状态码 {{HTTPStatus("405")}} <code>Method Not Allowed,则该首部字段亦需要同时返回给客户端。如果</code> <code>Allow</code> 首部字段的值为空,说明资源不接受使用任何 HTTP 方法的请求。这是可能的,比如服务器需要临时禁止对资源的任何访问。</p>
<table class="properties">
<tbody>
<tr>
<th scope="row">Header type</th>
<td>{{Glossary("Entity header")}}</td>
</tr>
<tr>
<th scope="row">{{Glossary("Forbidden header name")}}</th>
<td>no</td>
</tr>
</tbody>
</table>
<h2 id="语法">语法</h2>
<pre class="syntaxbox">Allow: <http-methods>
</pre>
<h2 id="声明">声明</h2>
<dl>
<dt><http-methods></dt>
<dd><a href="/en-US/docs/Web/HTTP/Methods">HTTP </a>请求方法的集合。</dd>
</dl>
<h2 id="示例">示例</h2>
<pre>Allow: GET, POST, HEAD</pre>
<h2 id="规范">规范</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Specification</th>
<th scope="col">Title</th>
</tr>
<tr>
<td>{{RFC("7231", "Allow", "7.4.1")}}</td>
<td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</td>
</tr>
</tbody>
</table>
<h2 id="参见">参见</h2>
<ul>
<li>{{HTTPStatus("405")}}</li>
<li>{{HTTPHeader("Server")}}</li>
</ul>
|