From 03c4340e4c4d2c1bfc90b195b822420cdf4216cc Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Fri, 27 Sep 2019 14:04:52 +0200 Subject: [PATCH] fix(core): update --- ts/index.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ts/index.ts b/ts/index.ts index c0eae1f..b6dfdb7 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -4,9 +4,8 @@ import * as plugins from './webrequest.plugins'; * web request */ export class WebRequest { - public async getJson(urlArg: string | string[], requestBody?: any) { + public async getJson(urlArg: string | string[]) { const response: Response = await this.request(urlArg, { - body: requestBody, method: 'GET' }); return response.json(); @@ -18,7 +17,7 @@ export class WebRequest { public async postJson(urlArg: string, requestBody?: any) { const response: Response = await this.request(urlArg, { body: requestBody, - method: 'GET' + method: 'POST' }); return response.json(); } @@ -29,7 +28,7 @@ export class WebRequest { public async putJson(urlArg: string, requestBody?: any) { const response: Response = await this.request(urlArg, { body: requestBody, - method: 'GET' + method: 'PUT' }); return response.json(); } @@ -37,9 +36,8 @@ export class WebRequest { /** * put js */ - public async deleteJson(urlArg: string, requestBody?: any) { + public async deleteJson(urlArg: string) { const response: Response = await this.request(urlArg, { - body: requestBody, method: 'GET' }); return response.json();