I have a specific task: I need to upload an image from the source URL and upload it to another host via a POST request as multipart / form-data. I am trying to use the node.js query library but it never succeeds. The following code does not send anything to the request body.
request.post({
url: uploadUrl,
formData: {
photo: request(imageUri)
}
}, function (err) {
if (err) console.error(err.stack)
});
I tried publishing directly through the form data library, but it doesn't seem to work. How to solve this problem without creating temporary files?
source
share