title: Angular 5 Post data with Nodejs - Wrong format of body
body: <p>I am using nodejs as back-end for angular 5 application . When I am posting data with http post request then it coming at nodejs in wrong formate (Values as property)- 
  This is my service code of angular 5 -</p>
  
  <pre><code>login(email: string, password: string) {
      let headers = new Headers({ 'Content-Type': 'application/x-www-form-urlencoded' });
      let options = new RequestOptions({ headers: headers });
      let body = { EmailAddress: email, Password: password };
  
      return this.http.post('http://localhost:3000/api/user/login', body, options )
          .map((response: Response) =&gt; {
              let user = response.json();
              if (user &amp;&amp; user.token) {
                  localStorage.setItem('currentUser', JSON.stringify(user));
              }
          });
  }
  </code></pre>
  
  <p>This is Node API - in body I am getting value as property</p>
  
  <pre><code>app.post('/api/user/login', urlencodedBodyparser, function (req, res) {
      console.log(req.body);
      User.find({ "EmailAddress": req.body["EmailAddress"], "Password": req.body["Password"] }, function (err, users) {
          console.log(users.length);
          if (err != null) {
              sendError(err, res);
          }
          if (users != null) {
              var count = users.length;
              if (count &gt; 0) {
                  response.data = users[0];
                  res.json(response);
              }
              else {
                  sendError({ message :'No user found'}, res);
                  console.log("Login Failed");
              }
          }
          else {
              sendError(err, res);
          }
      })
  });
  </code></pre>
  
  <p>Code for body parser - </p>
  
  <p>var bodyParser = require('body-parser');</p>
  
  <p>var urlencodedBodyparser = bodyParser.urlencoded({ extended: false });</p>
  
  <p>app.use(urlencodedBodyparser);</p>
  
  <p><a href="https://i.stack.imgur.com/5T9qK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5T9qK.png" alt="enter image description here"></a></p>