From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../access-control-allow-methods/index.html | 84 ++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 files/zh-cn/web/http/headers/access-control-allow-methods/index.html (limited to 'files/zh-cn/web/http/headers/access-control-allow-methods/index.html') 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 +--- +

{{HTTPSidebar}}

+ +

响应首部 Access-Control-Allow-Methods 在对 {{glossary("preflight request")}}.(预检请求)的应答中明确了客户端所要访问的资源允许使用的方法或方法列表。

+ + + + + + + + + + + + +
报头类型{{Glossary("Response header")}}
{{Glossary("Forbidden header name")}}no
+ +

语法

+ +
Access-Control-Allow-Methods: <method>, <method>, ...
+
+ +

指令

+ +
+
<method>
+
用逗号隔开的允许使用的 HTTP request methods 列表。
+
+ +

例子

+ +
Access-Control-Allow-Methods: POST, GET, OPTIONS
+ +

规范

+ + + + + + + + + + + + + + +
规范状态注释
{{SpecName('Fetch','#http-access-control-allow-methods', 'Access-Control-Allow-Methods')}}{{Spec2("Fetch")}}Initial definition
+ +

浏览器兼容性

+ + + +

{{Compat("http.headers.Access-Control-Allow-Methods")}}

+ +

兼容性注解

+ + + +

查看更多

+ + -- cgit v1.2.3-54-g00ecf