I would like to pass a readable stream to the post request body using pipe
, but am having trouble. This is the code I have:
var request = require('request');
var fs = require('fs');
var source = fs.createReadStream('./originalJsonDataWithObject.json'); //creating a read stream to read the file
source.pipe(request.post('http://localhost:3030/decompress')); //piping it to the post request