@hubs101/js-api-skd-client 1.0.10293 → 1.0.10294
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
|
@@ -353,8 +353,9 @@ const postRequestWE = (url, body, token, headers) => __awaiter(void 0, void 0, v
|
|
|
353
353
|
var _e;
|
|
354
354
|
let form;
|
|
355
355
|
if (body) {
|
|
356
|
-
if (headers &&
|
|
357
|
-
headers["Content-Type"] === "application/x-www-form-urlencoded")
|
|
356
|
+
if ((headers &&
|
|
357
|
+
headers["Content-Type"] === "application/x-www-form-urlencoded") ||
|
|
358
|
+
headers["Content-Type"] === "application/json") {
|
|
358
359
|
form = new URLSearchParams();
|
|
359
360
|
}
|
|
360
361
|
else {
|
|
@@ -364,6 +365,7 @@ const postRequestWE = (url, body, token, headers) => __awaiter(void 0, void 0, v
|
|
|
364
365
|
? form.append(key, JSON.stringify(body[key]))
|
|
365
366
|
: form.append(key, body[key]));
|
|
366
367
|
}
|
|
368
|
+
console.log({ body });
|
|
367
369
|
console.log({ form });
|
|
368
370
|
const response = yield fetch(url, {
|
|
369
371
|
method: "POST",
|