title: Posting nested object to nodejs server via ajax is returning undefined
body: <p>I've been trying to figure this out for a few hours already but I can't seem to find the cause of the issue.</p>
  
  <p>On the client-side Javascript I'm posting a nested object via ajax to my backend nodejs server. The ajax looks like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>$.ajax({
    type: "POST",
    url: "/user/save",
    data: {
      "account": {
        "username": $signupForm.find("input[name='register_username']").val(),
        "email": $signupForm.find("input[name='register_email']").val(),
        "password": $signupForm.find("input[name='register_password']").val(),
        "plan": subscription
      },
      "stripe": stripeResponse
    },
    dataType: "json",
    beforeSend: function(){
      $.fn.showLoading();
    },
    success: function(data){
  
    }
  });
  </code></pre>
  
  <p>Then I catch this in my routes/index.js</p>
  
  <pre class="lang-js prettyprint-override"><code>router.post('/user/save', function(req, res){
    var post_data = req.body;
    console.info(post_data);
  
    var account = post_data.account;
    var card = post_data.stripe;
  
    console.log(account);
    console.log(card);
  
    // Rest of code...
  </code></pre>
  
  <p>The problem here now is that for some reason, both <code>post_data.account</code> and <code>post_data.stripe</code> are returned as undefined. post_data itself does indeed return the data.</p>
  
  <p>I also tried sending the data from ajax using <code>JSON.stringify</code> but that didn't work as well.</p>
  
  <p>I also have body-parser required and in use under app.js</p>
  
  <p>I can't see where my problem is. Why is my data undefined?</p>