Access-Control-Allow-Methods
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
语法
http
Access-Control-Allow-Methods: <method>, <method>, …
Access-Control-Allow-Methods: *
指令
- <method>
-
一个以逗号分隔,表示允许使用的 HTTP 请求方法的列表。
*
(通配符)-
“
*
”值仅在无凭据的请求(即不包含 HTTP cookie 或 HTTP 认证信息的请求)中视为特殊的通配符值。在带有凭据的请求中,它被当作字面意义的标头名称“*
”处理,不具有特殊语义。
示例
http
Access-Control-Allow-Methods: GET, POST
Access-Control-Allow-Methods: *
规范
Specification |
---|
Fetch Standard # http-access-control-allow-methods |
浏览器兼容性
BCD tables only load in the browser