title: Submitting a File in a POST Request With NodeJS
body: <p>Similar to <a href="https://stackoverflow.com/questions/18535799/send-fileparameters-in-post-request">Send file+parameters in post request
  </a> post I am trying to submit a file to an HTML form using Node.js.</p>
  
  <p>I am currently trying to use the <a href="https://www.npmjs.com/package/http-post" rel="nofollow noreferrer">http-post package</a> however my code is currently executing without any errors but without submitting the form properly.</p>
  
  <pre><code>var http = require('http');
  http.post = require('http-post');
  
  var files = {
      param: "file",
      path: "&lt;filepath&gt;",
      Headers: 'update=&lt;filename&gt;'
  };
  
  http.get('http://192.168.84.22/update');
  
  http.post('http://192.168.84.22/update', 'update=&lt;filename&gt;', files, function(res){});
  </code></pre>
  
  <p>I have captured the HTTP request that I am trying to recreate programmatically from when I have manually submitted the file:</p>
  
  <p><a href="https://i.stack.imgur.com/kNS6L.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kNS6L.png" alt="Desired HTTP Request"></a></p>