mirror of
https://github.com/fjogeleit/http-request-action.git
synced 2024-12-23 04:37:28 +00:00
Check for empty dataJson
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
This commit is contained in:
parent
6796716641
commit
6c12bc1f79
1 changed files with 1 additions and 1 deletions
|
@ -59,7 +59,7 @@ const request = async({ method, instanceConfig, data, files, file, actions, igno
|
||||||
|
|
||||||
if (instanceConfig.headers[HEADER_CONTENT_TYPE] === CONTENT_TYPE_URLENCODED) {
|
if (instanceConfig.headers[HEADER_CONTENT_TYPE] === CONTENT_TYPE_URLENCODED) {
|
||||||
let dataJson = convertToJSON(data)
|
let dataJson = convertToJSON(data)
|
||||||
if (typeof dataJson === 'object') {
|
if (typeof dataJson === 'object' && Object.keys(dataJson).length) {
|
||||||
data = (new url.URLSearchParams(dataJson)).toString();
|
data = (new url.URLSearchParams(dataJson)).toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue