Add the PATCH method to the available request methods. (#1692)
This commit is contained in:
parent
52975fbe1e
commit
395b65185b
|
@ -6,7 +6,7 @@ const redirectCodes = new Set([301, 302, 307, 308]);
|
|||
|
||||
/**
|
||||
* @typedef {Object} FetchOptions
|
||||
* @property {"GET" | "PUT" | "POST" | "DELETE"} [method] - Request method.
|
||||
* @property {"GET" | "PUT" | "POST" | "DELETE" | "PATCH"} [method] - Request method.
|
||||
* @property {Record<string, string>} [headers] - Request headers.
|
||||
* @property {"manual" | "follow"} [redirect] - Whether to follow redirects.
|
||||
* @property {number} [maxRedirects] - Maximum amount of redirects to be followed.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import Remote from "../../polyfill/remote";
|
||||
|
||||
const methods = new Set(["GET", "PUT", "POST", "DELETE"]);
|
||||
const methods = new Set(["GET", "PUT", "POST", "DELETE", "PATCH"]);
|
||||
const bodylessStatusCodes = new Set([101, 204, 205, 304]);
|
||||
|
||||
class FetchResponse extends Response {
|
||||
|
@ -35,7 +35,7 @@ const convertSignal = signal => {
|
|||
|
||||
/**
|
||||
* @typedef {Object} FetchOptions
|
||||
* @property {"GET" | "PUT" | "POST" | "DELETE"} [method] - Request method.
|
||||
* @property {"GET" | "PUT" | "POST" | "DELETE" | "PATCH"} [method] - Request method.
|
||||
* @property {Record<string, string>} [headers] - Request headers.
|
||||
* @property {"manual" | "follow"} [redirect] - Whether to follow redirects.
|
||||
* @property {number} [maxRedirects] - Maximum amount of redirects to be followed.
|
||||
|
|
Loading…
Reference in New Issue