title: Uploading file and data from Python to Node.js in POST
body: <p>How do I send a file to Node.js AND parameter data in POST.  I am happy to use any framework.  I have attempted it with formidable but I am happy to change.  </p>
  
  <p>In my attempt, the file sends, but req.body is empty</p>
  
  <p>Python code to upload:</p>
  
  <pre><code>   with open('fileName.txt', 'rb') as f: 
          payLoad = dict()
          payLoad["data"] = "my_data"
          r = requests.post('http://xx.xx.xx.xx:8080/sendFile',json = payLoad, files={'fileName.txt': f})
  </code></pre>
  
  <p>Server Side Node.js:</p>
  
  <pre><code>var express = require('express');
  var formidable = require('formidable');
  var app = express();
  var bodyParser = require('body-parser');
  
  app.use( bodyParser.json() ); 
  app.use(bodyParser.urlencoded({ extended: false })); 
  
  app.post('/sendFile', function (req, res){
      console.log(req.body )
      // req.body is empty
  </code></pre>