fix(core): update

This commit is contained in:
Philipp Kunz 2022-05-29 20:53:16 +02:00
parent d4f022a2d9
commit 12dc003226
2 changed files with 3 additions and 2 deletions

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@pushrocks/webrequest', name: '@pushrocks/webrequest',
version: '3.0.5', version: '3.0.6',
description: 'securely request from browsers' description: 'securely request from browsers'
} }

View File

@ -44,11 +44,12 @@ export class WebRequest {
/** /**
* postJson * postJson
*/ */
public async postJson(urlArg: string, requestBody?: any, useStoreAsFallback: boolean = false) { public async postJson(urlArg: string, requestBody?: any, useCacheArg: boolean = false) {
await WebRequest.neededPolyfillsLoadedDeferred.promise; await WebRequest.neededPolyfillsLoadedDeferred.promise;
const response: Response = await this.request(urlArg, { const response: Response = await this.request(urlArg, {
body: plugins.smartjson.stringify(requestBody), body: plugins.smartjson.stringify(requestBody),
method: 'POST', method: 'POST',
useCache: useCacheArg
}); });
const responseText = await response.text(); const responseText = await response.text();
const responseResult = plugins.smartjson.parse(responseText); const responseResult = plugins.smartjson.parse(responseText);