From 467f8d3254724f350b7bddbcc0bd006c61a6aec6 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Fri, 27 Sep 2019 21:20:06 +0200 Subject: [PATCH] fix(core): update --- ts/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ts/index.ts b/ts/index.ts index ea9e35d..5f873ec 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -16,7 +16,7 @@ export class WebRequest { */ public async postJson(urlArg: string, requestBody?: any) { const response: Response = await this.request(urlArg, { - body: requestBody, + body: JSON.stringify(requestBody), method: 'POST' }); return response.json(); @@ -27,7 +27,7 @@ export class WebRequest { */ public async putJson(urlArg: string, requestBody?: any) { const response: Response = await this.request(urlArg, { - body: requestBody, + body: JSON.stringify(requestBody), method: 'PUT' }); return response.json(); @@ -89,7 +89,7 @@ export class WebRequest { if (!urlToUse) { throw new Error('request failed permanently'); } - + console.log(`Getting ${urlToUse} with method ${optionsArg.method}`); const response = await fetch(urlToUse, { method: optionsArg.method, headers: {