Uploading file using POST request in Node.js
Looks like you’re already using request module. in this case all you need to post multipart/form-data is to use its form feature: var req = request.post(url, function (err, resp, body) { if (err) { console.log(‘Error!’); } else { console.log(‘URL: ‘ + body); } }); var form = req.form(); form.append(‘file’, ‘<FILE_DATA>’, { filename: ‘myfile.txt’, contentType: ‘text/plain’ … Read more