title: nodeJs - post request with form-data using Unirest
body: <p><a href="https://i.stack.imgur.com/ndYMV.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ndYMV.jpg" alt="postman request"></a></p>
  
  <p>how can I post a file(please refer my screenshot) with unirest in node.js. I have gone through unirest <a href="http://unirest.io/nodejs.html" rel="nofollow noreferrer">doc</a>
  it's found that can use the below code for sending form-data to a given URL</p>
  
  <pre><code>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);
  });
  </code></pre>
  
  <p>please have a look at the screenshot attached. needed to give the key name as 'html'.</p>
  
  <p>how to export the same postman request to node.js(unirest)</p>