fix(core): update

This commit is contained in:
Philipp Kunz 2022-02-15 23:09:15 +01:00
parent e55a521395
commit 7c4227bfc6

View File

@ -72,14 +72,6 @@ export const postFormDataUrlEncoded = async (
optionsArg: interfaces.ISmartRequestOptions = {},
payloadArg: { key: string; content: string }[]
) => {
const requestOptions = {
...optionsArg,
method: 'POST',
headers: {
...optionsArg.headers,
'content-type': 'application/x-www-form-urlencoded',
},
};
let resultString = '';
@ -92,7 +84,17 @@ export const postFormDataUrlEncoded = async (
)}`;
}
const requestOptions: interfaces.ISmartRequestOptions = {
...optionsArg,
method: 'POST',
headers: {
...optionsArg.headers,
'content-type': 'application/x-www-form-urlencoded',
},
requestBody: resultString
};
// lets fire the actual request for sending the formdata
const response = await request(`${urlArg}?${resultString}`, requestOptions);
const response = await request(urlArg, requestOptions);
return response;
};