title: NodeJS convert request body to uppercase and return in response
body: <p>With below code I planned to convert req body to uppercase and return in res and also print it stdout, when I test res is never fetched, and http connection is alive forever.  Please can someone point the mistake here. </p>
  
  <pre><code>var http =require('http'); 
  var fs = require('fs');
  var through = require('through2');
  
  var server = http.createServer(function(req,res){
               if(req.method==='POST'){
                  req.pipe(through(function(buffer,encoding,next){
                          //console.log()
                          this.push(buffer.toString().toUpperCase());
                          next();
                      })).pipe(process.stdout).pipe(res) // If remove .pipe(process.stdout) then I get response.
  
               }
               //res.end(); -- If I enable this I do get a blank response with 200 OK
              })
  
  server.listen(process.argv[2]);
  </code></pre>