title: Body-parse in Node.js not escaping new line chars in request body ? JSON
body: <p>I am creating a basic reverse proxy to pass on client requests to a remote server.</p>
  
  <p>So I used body-parse with express.js for Node server to allow me to pass on the body.</p>
  
  <p>However the JSON contains new line characters in it and extra braces.</p>
  
  <p><strong>Client Side</strong></p>
  
  <pre><code>{
     "lastRefreshedDateTime" : "2015-05-24",
     "uid" : "1232141451"
  }
  </code></pre>
  
  <p><strong>Server Side</strong></p>
  
  <pre><code>{
      '{
          \r\n"lastRefreshedDateTime": "2015-05-24",
          \r\n"uid
  ": "1234567124321"\r\n
      }\r\n': ''
  }
  </code></pre>
  
  <p><strong>Node.js code</strong></p>
  
  <pre><code>        var express = require('express');
      var http = require('request');
      var path = require('path');
      var url = require("url");
      var bodyParser = require("body-parser"); //this is required in express 4.x to output the contents of the client request body
      var app = express(); //start express server
  
      // parse application/x-www-form-urlencoded
  //app.use(bodyParser.urlencoded({ extended: false }))
  
  // parse application/json
  app.use(bodyParser().json())
      // POST - getLocationData
      app.post('/getLocationData', function (request, response)
      {
          console.log("Request for /getLocationData");
          forwardRequest(request, response, "getLocationData", "POST", true);
      });
  
  
      app.listen(8080);
  
      function forwardRequest(request, response, serviceName, requestMethod, isJSON)
      {
  
          console.log("Making request to EAS for " + serviceName + ":");
          console.log(request.body); //json is fubar!
  
      };
  </code></pre>
  
  <p>I have tried removing the new line characters myself, but it still doesnt solve the problem of the additional braces and inverted commans</p>