From d4e3c487f20fe9925c9c6a20f659f5076fe6eb41 Mon Sep 17 00:00:00 2001 From: JounQin Date: Sun, 18 Feb 2024 19:32:07 +0800 Subject: [PATCH] fix: allow more methods to use used (#18) --- .changeset/curvy-paws-laugh.md | 5 +++++ src/types.ts | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 .changeset/curvy-paws-laugh.md diff --git a/.changeset/curvy-paws-laugh.md b/.changeset/curvy-paws-laugh.md new file mode 100644 index 0000000..1e7f910 --- /dev/null +++ b/.changeset/curvy-paws-laugh.md @@ -0,0 +1,5 @@ +--- +"x-fetch": patch +--- + +fix: allow more methods to use used diff --git a/src/types.ts b/src/types.ts index 8fe5af8..e74638a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -24,12 +24,17 @@ export type URLSearchParamsOptions = | URLSearchParamsInit | object +// https://www.rfc-editor.org/rfc/rfc9110#section-9.1-4 export const ApiMethod = { + CONNECT: 'CONNECT', + DELETE: 'DELETE', GET: 'GET', - POST: 'POST', + HEAD: 'HEAD', + OPTIONS: 'OPTIONS', PATCH: 'PATCH', + POST: 'POST', PUT: 'PUT', - DELETE: 'DELETE', + TRACE: 'TRACE', } as const export type ApiMethod = ValueOf