Access-Control-Allow-Methods
{{HTTPSidebar}}
The HTTP Access-Control-Allow-Methods
{{Glossary("response header")}}
specifies one or more HTTP request methods allowed when accessing a resource in response to a {{glossary("preflight request")}}
.
Header type | `{{Glossary("Response header")}}` |
---|---|
`{{Glossary("Forbidden header name")}}` | No |
Syntax
Access-Control-Allow-Methods: <method>, <method>, …
Access-Control-Allow-Methods: *
Directives
<method>
- : A comma-separated list of the allowed request methods.
GET
,HEAD
, andPOST
are always allowed, regardless of whether they are specified in this header, as they are defined as CORS-safelisted methods.
- : A comma-separated list of the allowed request methods.
*
(wildcard)- : All HTTP methods.
It has this meaning only for requests without credentials (requests without HTTP cookies or HTTP authentication information). In requests with credentials, it is
treated as the literal method name
*
without special semantics.
- : All HTTP methods.
It has this meaning only for requests without credentials (requests without HTTP cookies or HTTP authentication information). In requests with credentials, it is
treated as the literal method name
Examples
Access-Control-Allow-Methods: PUT, DELETE
Access-Control-Allow-Methods: *
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
{{HTTPHeader("Access-Control-Allow-Origin")}}
{{HTTPHeader("Access-Control-Expose-Headers")}}
{{HTTPHeader("Access-Control-Allow-Headers")}}
{{HTTPHeader("Access-Control-Request-Method")}}
- HTTP request methods