Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
d9e6214a7e | |||
7c4227bfc6 |
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@pushrocks/smartrequest",
|
||||
"version": "1.1.55",
|
||||
"version": "1.1.56",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@pushrocks/smartrequest",
|
||||
"version": "1.1.55",
|
||||
"version": "1.1.56",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@pushrocks/smartpromise": "^3.1.6",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartrequest",
|
||||
"version": "1.1.55",
|
||||
"version": "1.1.56",
|
||||
"private": false,
|
||||
"description": "dropin replacement for request",
|
||||
"main": "dist_ts/index.js",
|
||||
|
@ -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;
|
||||
};
|
||||
|
Reference in New Issue
Block a user