how can I post a file(please refer my screenshot) with unirest in node.js. I have gone through unirest doc it's found that can use the below code for sending form-data to a given URL
unirest.post('http://mockbin.com/request')
.headers({'Content-Type': 'multipart/form-data'})
.field('parameter', 'value') // Form field
.attach('file', '/tmp/file') // Attachment
.end(function (response) {
console.log(response.body);
});
please have a look at the screenshot attached. needed to give the key name as 'html'.
how to export the same postman request to node.js(unirest)