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 HTTP-Anfragemethoden an, die beim Zugriff auf eine Ressource als Antwort auf eine Preflight-Anfrage zulässig 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 zulässigen Anfragemethoden. GET, HEAD und POST sind immer zulässig, 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 bei Anfragen ohne Anmeldeinformationen (Anfragen ohne HTTP-Cookies oder HTTP-Authentifizierungsinformationen) diese Bedeutung. Bei Anfragen mit Anmeldeinformationen wird es als der methodische Name * 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

BCD tables only load in the browser

Siehe auch