overrideMethod
constoverrideMethod: (config?) =>Policy
Defined in: src/policies/transform/override-method.ts:41
Override the HTTP method of a POST request via a header.
Only applies to POST requests — the industry-standard approach for tunneling other methods through POST. Non-POST requests with the override header are ignored.
Parameters
Section titled “Parameters”config?
Section titled “config?”Header name and allowed override methods.
Returns
Section titled “Returns”A policy at priority 5 (EARLY).
Example
Section titled “Example”// Default: reads X-HTTP-Method-Override headeroverrideMethod();
// Custom header and restricted methodsoverrideMethod({ header: "X-Method", allowedMethods: ["PUT", "PATCH"] });