title: Poco::Net::HTTPClientSession json data Content-Type not received
body: <p>So I am developing a server side Nodejs/expressjs app and a clientside c++/Poco app. I've managed to create a session between where the server is hosted and client. However, any time i try to send my JSON payload, express.js shows req.body as empty.</p>
  
  <p>Google didn't reveal much besides that Content-Type was likely not being transmitted correctly and it appears so. I do set it explicitly but apparently i'm missing a step.</p>
  
  <p>client-side</p>
  
  <pre><code>void upload(std::list&lt;std::string&gt;&amp; args) {
      if (args.size() == 0 || args.front() == "--help") {
          help("upload");
          return;
      }
  
      std::string repo = args.front();
      args.pop_front();
  
      std::string name, language;
      auto depends = getDepends(name, language);
  
      // start making the poco json object here
      Poco::JSON::Object obj;
      obj.set("name", name);
      obj.set("url", repo);
  
      Poco::URI uri("http://url-of-my-server:50001/make_repo");
      std::string path(uri.getPathAndQuery());
  
  
      if (path.empty()) path = "/";
  
      HTTPClientSession session(uri.getHost(), uri.getPort());
      HTTPRequest request(HTTPRequest::HTTP_POST, path, HTTPMessage::HTTP_1_1);
      HTTPResponse response;
  
      std::ostream&amp; o = session.sendRequest(request);
  
      std::cout &lt;&lt; response.getStatus() &lt;&lt; " " &lt;&lt; response.getReason() &lt;&lt; std::endl;
  
      session.setKeepAlive(true);
      request.setContentType("application/json");  // definately set Content-Type right?
      obj.stringify(std::cout);                    // can confirm it is spitting out the valid json here
      obj.stringify(o);                            // place the json in the request stream
  
      std::istream&amp; s = session.receiveResponse(response);
  
      // do stuff with returned data
  }
  </code></pre>
  
  <p>server:</p>
  
  <pre><code>var express = require('express');
  var app = express();
  var bodyParser = require('body-parser');
  
  var database = require('./database.js');  // one of my files
  var connection = database.connection;
  app.use(bodyParser.urlencoded({extended: true}));
  app.use(bodyParser.json());
  
  var port = 50001;   // explicitly set port because environment port kept forcing port 3000
  
  // just a callback to make sure i'm connected to my sql server
  connection.query('SELECT 1',function(err, rows) {
      if(err) {
          console.error("Could not connect to the database.");
      } else {
          console.log('connected to database: ' + connection.threadId);
      }
  
      app.get('/', function(req, res){
          res.send('hello world');
      });
  
      // this is the route I invoke, (and it is definately invoked)
      app.post('/make_repo', function(req, res, next) {
  
          console.log(req.headers); // this always returns '{ connection: 'Close', host: 'url-of-my-server:50001' }
          console.log(req.body); // this always returns '{}'
  
      });
  
      var listener = app.listen(port, function() {
          console.log("port: " + listener.address().port);
      });
  
  });
  </code></pre>
  
  <p>It appears that this is on Poco's end because I can transmit test data from postman and it reports just fine. I also setKeepAlive to true on Poco and that appears to be ignored as well. Has anyone used Poco enough to help?</p>