Support form-data arrays

This commit is contained in:
Ben Hardill 2022-12-24 19:32:33 +00:00
parent 4115c13a65
commit 5670bd8265
No known key found for this signature in database
GPG Key ID: 74DD076979ABB1E7
1 changed files with 4 additions and 0 deletions

View File

@ -435,6 +435,10 @@ in your Node-RED user directory (${RED.settings.userDir}).
formData.append(opt, val);
} else if (typeof val === 'object' && val.hasOwnProperty('value')) {
formData.append(opt,val.value,val.options || {});
} else if (Array.isArray(val)) {
for (var i=0; i<val.length; i++) {
formData.append(opt, val[i])
}
} else {
formData.append(opt,JSON.stringify(val));
}