@hubs101/js-api-skd-client 1.0.10295 → 1.0.10296
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/utils/api.js +4 -2
- package/package.json +1 -1
package/lib/utils/api.js
CHANGED
|
@@ -366,12 +366,14 @@ const postRequestWE = (url, body, token, headers) => __awaiter(void 0, void 0, v
|
|
|
366
366
|
: form.append(key, body[key]));
|
|
367
367
|
}
|
|
368
368
|
console.log({ body });
|
|
369
|
-
console.log(
|
|
369
|
+
console.log(JSON.stringify(body));
|
|
370
370
|
const response = yield fetch(url, {
|
|
371
371
|
method: "POST",
|
|
372
372
|
headers: token
|
|
373
373
|
? Object.assign({ Authorization: `Bearer ${token}` }, headers) : Object.assign({}, headers),
|
|
374
|
-
body:
|
|
374
|
+
body: headers["Content-Type"] === "application/json"
|
|
375
|
+
? JSON.stringify(body)
|
|
376
|
+
: form,
|
|
375
377
|
});
|
|
376
378
|
if (String(response.status).startsWith("5")) {
|
|
377
379
|
throw new Error(response.statusText);
|