@dotdev/harmony-sdk 1.14.0 → 1.15.0
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/dist/helpers/index.js +10 -3
- package/package.json +1 -1
package/dist/helpers/index.js
CHANGED
|
@@ -9,20 +9,27 @@ export class ApiHelper {
|
|
|
9
9
|
static async sendSoapRequest(endpoint, axiosInstance, requestBody, type = "POST") {
|
|
10
10
|
const url = `${endpoint}?wsdl`;
|
|
11
11
|
let response;
|
|
12
|
+
let defaultConfig = {
|
|
13
|
+
headers: {
|
|
14
|
+
'Accept-Encoding': 'gzip, deflate, br' //Override default Accept-Encoding
|
|
15
|
+
}
|
|
16
|
+
};
|
|
12
17
|
try {
|
|
13
18
|
let response;
|
|
14
19
|
switch (type) {
|
|
15
20
|
case "GET":
|
|
16
21
|
response = await axiosInstance.get(url, {
|
|
22
|
+
...defaultConfig,
|
|
17
23
|
params: {},
|
|
18
24
|
});
|
|
19
25
|
break;
|
|
20
26
|
case "POST":
|
|
21
27
|
default:
|
|
22
28
|
response = await axiosInstance.post(url, requestBody, {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
...defaultConfig
|
|
30
|
+
// headers: {
|
|
31
|
+
// 'SOAPAction': request.action
|
|
32
|
+
// }
|
|
26
33
|
});
|
|
27
34
|
break;
|
|
28
35
|
}
|