From 7acab4c1f0caadebd7f3ba2cd6d642578fc24998 Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Thu, 9 Nov 2023 11:44:39 +0100 Subject: [PATCH] fix: no request body on GET requests --- package.json | 2 +- src/Reflect.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 87bd638..77e656c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "reflect-client", - "version": "1.1.0", + "version": "1.1.1", "main": "build/Reflect.js", "type": "module", "exports": { diff --git a/src/Reflect.ts b/src/Reflect.ts index f424c76..ca03443 100644 --- a/src/Reflect.ts +++ b/src/Reflect.ts @@ -34,8 +34,8 @@ export default class Client { headers: this.headers } - // JSON stringify and append body to request if provided - if (payload) { + // JSON stringify and append body to request if provided and is not a GET request + if (payload && method !== Method.GET) { options["body"] = JSON.stringify(payload); }