mirror of
https://github.com/fjogeleit/http-request-action.git
synced 2026-02-04 16:45:52 +08:00
Check for empty dataJson
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
This commit is contained in:
@@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user