title: NodeJS: forward form-data to external API
body: <p>Looking for help to solve my issue, any advice appreciated!</p>
  
  <p>So I'm uploading csv file as formdata to Node environment with XHR request:</p>
  
  <pre><code>       var FormData = new FormData();
      var file = input.files[0];
  FormData .append("file", file);
  </code></pre>
  
  <p>In the Node environment I receive the following under req.files with JSON.stringify:
  <a href="https://i.stack.imgur.com/YJZ38.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YJZ38.png" alt="req.files"></a></p>
  
  <p>Next I need to add authorization header and send the same data to external API.</p>
  
  <p><strong>What I have tried:</strong></p>
  
  <ul>
  <li>using request module and ```.pipe()``</li>
  <li>using busboy</li>
  <li>and axios with form-data</li>
  <li>basically all these posts: <a href="https://stackoverflow.com/questions/53220350/how-to-forward-a-multipart-form-data-post-request-in-node-to-another-service">1</a>, <a href="https://stackoverflow.com/questions/13797670/nodejs-post-request-multipart-form-data">2</a>, <a href="https://stackoverflow.com/questions/52963648/how-to-pass-multipart-request-from-one-server-to-another-in-nodejs/53002980">3</a>, <a href="https://stackoverflow.com/questions/9327250/how-to-resend-post-multipart-form-data-form-with-upload-file-to-different-server">4</a>, <a href="https://stackoverflow.com/questions/46975590/how-to-upload-file-saved-in-memory-by-multer-to-another-api">5</a>, <a href="https://stackoverflow.com/questions/53590923/node-js-send-form-data-to-another-server">6</a>, <a href="https://stackoverflow.com/questions/51765755/sending-file-from-one-node-js-server-to-another">7</a></li>
  </ul>
  
  <p>But file is not being sent correctly and server responds with 400.</p>
  
  <p><strong>Limitations</strong> As this Node environment is cloud based I cannot access any of the config js files and therefore use express.</p>
  
  <p>Thanks</p>