title: node express no data getting to server
body: <p>Have looked for similar questions and can't find anything on this, so apologies if it already exists.</p>
  
  <p>I'm pretty new to front-end work so I've got a fairly simple personal project on the go. I've got a pretty basic node/express setup and am trying to initiate a GET request to the <code>/next-user</code> URL</p>
  
  <p>the GET is set up in the server as:</p>
  
  <pre><code>app.get('/next-user', function (req, res) {
      res.setHeader("Access-Control-Allow-Origin", "*");
      res.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
      console.log(req.body)
  })
  </code></pre>
  
  <p>I know a common issue with this is that the body-parser module is not setup, so here is my setup code:</p>
  
  <pre><code>var express = require('express');
  var app = express();
  var bodyParser = require('body-parser');
  app.use(bodyParser.urlencoded({extended: false}));
  </code></pre>
  
  <p>and the request is setup like;</p>
  
  <pre><code>    var data = {name:"HelloServerWorld"};
      console.log(data)
      $.getJSON("http://localhost:8081/next-user", data, function(response){
          console.log(response);
      });
  </code></pre>
  
  <p>The server always echos an empty JSON object regardless of what I send to it where the client can see that the object is populated. I didn't want to post the entirety of the code but if it's needed then let me know, but I'm fairly confident the problem lies in what I've given so far, I'm just not sure where</p>