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.

Der HTTP Access-Control-Allow-Methods Antwort-Header gibt eine oder mehrere zulässige HTTP-Anforderungsmethoden an, wenn auf eine Ressource als Antwort auf eine Preflight-Anfrage zugegriffen wird.

Header-Typ Antwort-Header
Verbotener Header-Name Nein

Syntax

http
Access-Control-Allow-Methods: <method>, <method>, …
Access-Control-Allow-Methods: *

Direktiven

<method>

Eine durch Kommas getrennte Liste der zulässigen Anforderungsmethoden. GET, HEAD und POST sind immer erlaubt, unabhängig davon, ob sie in diesem Header angegeben sind, da sie als CORS-safelisted methods definiert sind.

* (Platzhalter)

Alle HTTP-Methoden. Dies hat nur für Anfragen ohne Anmeldeinformationen (Anfragen ohne HTTP-Cookies oder HTTP-Authentifizierungsinformationen) diese Bedeutung. Bei Anfragen mit Anmeldeinformationen wird es als der wörtliche Methodenname * ohne besondere Semantik behandelt.

Beispiele

http
Access-Control-Allow-Methods: PUT, DELETE
Access-Control-Allow-Methods: *

Spezifikationen

Specification
Fetch
# http-access-control-allow-methods

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Access-Control-Allow-Methods
Wildcard (*)

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

Siehe auch