Revision 1143343 of Access-Control-Allow-Methods

  • Revision slug: Web/HTTP/Headers/Access-Control-Allow-Methods
  • Revision title: Access-Control-Allow-Methods
  • Revision id: 1143343
  • Created:
  • Creator: fscholz
  • Is current revision? Yes
  • Comment

Revision Content

{{HTTPSidebar}}

The Access-Control-Allow-Methods response header specifies the method or methods allowed when accessing the 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>, ...

Directives

<method>
Comma-delimited list of the allowed HTTP request methods.

Examples

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

Specifications

Specification Status Comment
{{SpecName('Fetch','#http-access-control-allow-methods', 'Access-Control-Allow-Methods')}} {{Spec2("Fetch")}} Initial definition

Browser compatibility

{{Compat("http/headers/access-control-allow-methods")}}

Compatibility notes

  • The wildcard value (*) that is mentioned in the latest specification, is not yet implemented in browsers:

See also

  • {{HTTPHeader("Access-Control-Allow-Origin")}}
  • {{HTTPHeader("Access-Control-Expose-Headers")}}
  • {{HTTPHeader("Access-Control-Allow-Headers")}}
  • {{HTTPHeader("Access-Control-Request-Methods")}}

Revision Source

<div>{{HTTPSidebar}}</div>

<p>The <strong><code>Access-Control-Allow-Methods</code></strong> response header specifies the method or methods allowed when accessing the resource in response to a {{glossary("preflight request")}}.</p>

<table class="properties">
 <tbody>
  <tr>
   <th scope="row">Header type</th>
   <td>{{Glossary("Response header")}}</td>
  </tr>
  <tr>
   <th scope="row">{{Glossary("Forbidden header name")}}</th>
   <td>no</td>
  </tr>
 </tbody>
</table>

<h2 id="Syntax">Syntax</h2>

<pre class="syntaxbox">
Access-Control-Allow-Methods: &lt;method&gt;, &lt;method&gt;, ...
</pre>

<h2 id="Directives">Directives</h2>

<dl>
 <dt>&lt;method&gt;</dt>
 <dd>Comma-delimited list of the allowed <a href="/en-US/docs/Web/HTTP/Methods">HTTP request methods</a>.</dd>
</dl>

<h2 id="Examples">Examples</h2>

<pre>
Access-Control-Allow-Methods: POST, GET, OPTIONS</pre>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</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="Browser_compatibility">Browser compatibility</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="Compatibility_notes">Compatibility notes</h2>

<ul>
 <li>The wildcard value (*) that is mentioned in the latest specification, is not yet implemented in browsers:
  <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="See_also">See also</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-Methods")}}</li>
</ul>
Revert to this revision