From 1a1b46e584c6276165f68eb71229927ce6e2f5ab Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 22 Jan 2024 12:43:45 +0000 Subject: [PATCH] The Content-Type entity-header field indicates the media type of the entity-body sent to the recipient. In our case it provides a 400 with sibil api --- src/client/AbstractClient.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/client/AbstractClient.ts b/src/client/AbstractClient.ts index 834d3d3..7607a1f 100644 --- a/src/client/AbstractClient.ts +++ b/src/client/AbstractClient.ts @@ -463,10 +463,13 @@ class AbstractClient { requestParams: RequestInit ): Promise { let params = requestParams; + let baseHeaders: HeadersInit = {}; - const baseHeaders: HeadersInit = { - 'Content-Type': 'application/json', - }; + if (params.method !== 'GET') { + baseHeaders = { + 'Content-Type': 'application/json', + }; + } if (accessToken) { baseHeaders.Authorization = `${this.sdk.config.authorizationType} ${accessToken}`;