From 4f62f6f288d624e8089b957c88d45b3f68283b0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=9C=E7=89=A9=E3=83=AA=E3=83=B3?= Date: Tue, 17 Jan 2023 06:47:46 +0900 Subject: [PATCH] =?UTF-8?q?application/json=20=E3=81=AE=20content-type=20h?= =?UTF-8?q?eader=20=E3=82=92=E3=83=87=E3=83=95=E3=82=A9=E3=83=AB=E3=83=88?= =?UTF-8?q?=E3=81=A7=E4=BB=98=E4=B8=8E=E3=81=99=E3=82=8B=20(#52)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/api.ts b/src/api.ts index 2cf848810..1704b6e46 100644 --- a/src/api.ts +++ b/src/api.ts @@ -19,6 +19,7 @@ export type FetchLike = (input: string, init?: { body?: string; credentials?: RequestCredentials; cache?: RequestCache; + headers: {[key in string]: string} }) => Promise<{ status: number; json(): Promise; @@ -75,6 +76,9 @@ export class APIClient { ...params, i: credential !== undefined ? credential : this.credential, }), + headers: { + 'Content-Type': 'application/json', + }, credentials: 'omit', cache: 'no-cache', }).then(async (res) => {