title: Uploading two files with POST in node.JS
body: <p>I've got the following code in Python:</p>
  
  <pre><code>import requests
  fileslist = [('file[]',('user_query.txt', open('user_query.txt', 'rb'), 'text/plain')),
                  ('file[]',('wheatData.csv', open('wheatData.csv', 'rb'), 'text/csv')),]
  
  r = requests.post('url',
      files=fileslist)
  </code></pre>
  
  <p>And I'm trying to convert it to a node.JS version. So far I've got this:</p>
  
  <pre><code>var request = require('request');
  var fs      = require('fs');
  
  var req = request.post(url, function (err, resp, body) {
    if (err) {
      console.log('Error!');
    } else {
      console.log(body);
    }
  });
  
  var form = req.form();
  form.append('wheatData.csv', fs.createReadStream('wheatData.csv'));
  form.append('user_query.txt', fs.createReadStream('user_query.txt'));
  </code></pre>
  
  <p>What am I doing wrong?</p>