Access-Control-Allow-Methods header

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 an, welche HTTP-Anfragemethoden beim Zugriff auf eine Ressource im Antwortkontext auf eine Vorab-Anfrage erlaubt sind.

Header-Typ Antwort-Header
Verbotener Anforderungs-Header Nein

Syntax

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

Direktiven

<method>

Eine durch Kommas getrennte Liste der erlaubten Anfragemethoden. 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.

* (Wildcard)

Alle HTTP-Methoden. Dies hat nur dann Bedeutung, wenn es sich um Anfragen ohne Anmeldeinformationen handelt (Anfragen ohne HTTP-Cookies oder HTTP-Authentifizierungsinformationen). Bei Anfragen mit Anmeldeinformationen wird es als der buchstäbliche 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

Siehe auch