aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/http/headers/access-control-allow-methods
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/http/headers/access-control-allow-methods
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/http/headers/access-control-allow-methods')
-rw-r--r--files/zh-cn/web/http/headers/access-control-allow-methods/index.html84
1 files changed, 84 insertions, 0 deletions
diff --git a/files/zh-cn/web/http/headers/access-control-allow-methods/index.html b/files/zh-cn/web/http/headers/access-control-allow-methods/index.html
new file mode 100644
index 0000000000..b7c91f8a3f
--- /dev/null
+++ b/files/zh-cn/web/http/headers/access-control-allow-methods/index.html
@@ -0,0 +1,84 @@
+---
+title: Access-Control-Allow-Methods
+slug: Web/HTTP/Headers/Access-Control-Allow-Methods
+tags:
+ - 跨域资源共享
+ - 首部
+translation_of: Web/HTTP/Headers/Access-Control-Allow-Methods
+---
+<p>{{HTTPSidebar}}</p>
+
+<p>响应首部 <strong><code>Access-Control-Allow-Methods</code></strong> 在对 {{glossary("preflight request")}}.(预检请求)的应答中明确了客户端所要访问的资源允许使用的方法或方法列表。</p>
+
+<table class="properties">
+ <tbody>
+ <tr>
+ <th scope="row">报头类型</th>
+ <td>{{Glossary("Response header")}}</td>
+ </tr>
+ <tr>
+ <th scope="row">{{Glossary("Forbidden header name")}}</th>
+ <td>no</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox">Access-Control-Allow-Methods: &lt;method&gt;, &lt;method&gt;, ...
+</pre>
+
+<h2 id="指令">指令</h2>
+
+<dl>
+ <dt>&lt;method&gt;</dt>
+ <dd>用逗号隔开的允许使用的 <a href="/en-US/docs/Web/HTTP/Methods">HTTP request methods</a> 列表。</dd>
+</dl>
+
+<h2 id="例子">例子</h2>
+
+<pre>Access-Control-Allow-Methods: POST, GET, OPTIONS</pre>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">规范</th>
+ <th scope="col">状态</th>
+ <th scope="col">注释</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('Fetch','#http-access-control-allow-methods', 'Access-Control-Allow-Methods')}}</td>
+ <td>{{Spec2("Fetch")}}</td>
+ <td>Initial definition</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p>
+
+<p>{{Compat("http.headers.Access-Control-Allow-Methods")}}</p>
+
+<h2 id="兼容性注解">兼容性注解</h2>
+
+<ul>
+ <li>最新规范中提到的通配符值(*)尚未在以下浏览器中实现:
+ <ul>
+ <li>Chromium: <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=615313">Issue 615313</a></li>
+ <li>Firefox: {{bug(1309358)}}</li>
+ <li>Servo: <a href="https://github.com/servo/servo/issues/13283">Issue 13283</a></li>
+ </ul>
+ </li>
+</ul>
+
+<h2 id="查看更多">查看更多</h2>
+
+<ul>
+ <li>{{HTTPHeader("Access-Control-Allow-Origin")}}</li>
+ <li>{{HTTPHeader("Access-Control-Expose-Headers")}}</li>
+ <li>{{HTTPHeader("Access-Control-Allow-Headers")}}</li>
+ <li>{{HTTPHeader("Access-Control-Request-Method")}}</li>
+</ul>