title: How to make post request from angular to node server
body: <p>When I print contents of request on Node server, I can't see the user data anywhere. </p>
  
  <p>Here is my Node server:</p>
  
  <pre><code>var http = require('http');
  http.createServer( function (request, response) {  
      console.log(request);
  }).listen(8080);
  console.log('Server running at http://127.0.0.1:8080/');
  </code></pre>
  
  <p>And here is Angular2 code:</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { HttpClient } from "@angular/common/http";
  import { Http, Response, Headers , RequestOptions } from "@angular/http";
  import 'rxjs/add/operator/retry'; // to be able to retry when error occurs
  import { Observable } from "rxjs/Rx";
  
  @Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
  })
  
  export class AppComponent implements OnInit{
    title = 'Angular Test';
    user = { id : 1, name : "Hello"};
    constructor (private http: Http) {}
  
    ngOnInit(): void {
      let headers = new Headers({ 'Content-Type': 'application/json' });
      let options = new RequestOptions({ headers: headers });
  
      console.log(this.user);
  
      this.http.post("http://localhost:8080/", this.user, options)
      .subscribe( 
      (err) =&gt; {
          if(err) console.log(err);
          console.log("Success"); 
      });
    }
  }
  </code></pre>
  
  <p>Can anyone help me out or explain how to handle http request in angular.</p>