title: Node.js: cannot get json object on localhost
body: <p>I have an android app that is going to send a json to my server where I will have a node.js express app. Meanwhile, I want to test it on my localhost.</p>
  
  <p>On my android code I send the json to:</p>
  
  <pre><code>   new HttpAsyncTask().execute("http://10.0.2.2:8080/ReceiveJson");
  </code></pre>
  
  <p>This code is triggered by a button and is working fine.</p>
  
  <p>Then in my app.js file I have the following code:</p>
  
  <pre><code>var express = require('express')
  , http = require('http');
  var app = express();
  app.set('port', process.env.PORT || 8080);
  app.get('/ReceiveJson', function(req, res) {
  
  console.log(req.body);
  res.send(req.body);
  res.json(req.body);
  res.send("ok");
  });
  
  http.createServer(app).listen(app.get('port'), function(){
    console.log('Express server listening on port ' + app.get('port'));
  });
  </code></pre>
  
  <p>In my terminal I run node app.js and I get just the answer "Express server is listening on port 8080". Nothing else.</p>
  
  <p>When I go to my browser and put </p>
  
  <pre><code>http://localhost:8080/ReceiveJson
  </code></pre>
  
  <p>I get "{}" as an answer.
  In my terminal I get the same answer.</p>
  
  <p>What do I have to do to receive the json?
  Thanks</p>