title: How to Pass a User object as parameter to node.js's Express api like asp.net
body: <p>I am learning node.js, i need to pass a User object to node.js's Express api, i have seen few documents for my question, but its all about <strong>bodyparser</strong>. but i need to know is bodyparser only the good solution for this problem, or i can send the User object as <strong>Object Type Data Type</strong> which .Net/Java do. i need to send the object exactly like given .net example.</p>
  
  <p><strong>User Object</strong></p>
  
  <pre><code>var user={
      "Id":1,
      "FullName":"Mr. X"
  }
  </code></pre>
  
  <p><strong>ASP.NET Method</strong>
  if i send the above user via ajax its automatically fit with my asp.net method's parameter(User u).</p>
  
  <pre><code>public IHttpActionResult Save(User u)
  {
      return Ok(_userService.Save(u));
  }
  </code></pre>
  
  <p><strong>Node.Js</strong></p>
  
  <pre><code>var req=require('body-parser');
  router.post('/save', function (req, res) {
      var user=req.body.User;
      return userServices.Save(user).then(function (results) {
          res.send(results);
      }).catch(function (reason) {
          res.send(reason);
      });
  });
  </code></pre>