title: Angular CLI post data wont reach api
body: <p>I have a small problem with my Http Service in my Angular CLI app.
  I have a form I need to submit. Data from this form are sent to API and stored into database.</p>
  
  <p>This is the service</p>
  
  <pre><code>import {Injectable} from "@angular/core";
  import {Http, Headers} from "@angular/http";
  
  @Injectable()
  export class HttpService {
      private api: string = "http://localhost/api/www/";
      constructor(private http: Http) {
  
      }
  
      insertRouteReview(data: {}) {
          const headers = new Headers({
              'Content-Type': 'application/x-www-form-urlencoded'
          });
          this.http.post(this.api+"route/addreview", data, {headers: headers});
      }
  }
  </code></pre>
  
  <p>Data sample:</p>
  
  <pre><code>{
    "reviewId": 1,
    "userId": 1,
    "routeId": 1,
    "ratio": 3,
    "description": "lorem ipsumaaa"
  }
  </code></pre>
  
  <p>Note: urlencoded is there before PHP cannot handle the application/json format.</p>
  
  <p>When I send the data via some tool (For example Restlet Client) like this</p>
  
  <p><a href="https://i.stack.imgur.com/bm595.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bm595.png" alt="enter image description here"></a></p>
  
  <p>The data are stored into DB successfully. So API should be fine.</p>
  
  <p>What Am I doing wrong in my angular app? I get no error when I click the button which gets the data and pass them into http service.</p>
  
  <p>E:</p>
  
  <p>Code which is triggered after submit button is clicked</p>
  
  <pre><code>  onSubmit() {
    let review: {} = {
        reviewId: +this.reviewForm.value.reviewId,
        userId: +this.userService.userId,
        routeId: +this.routeId,
        ratio: +this.reviewForm.value.ratio,
        description: this.reviewForm.value.description
    };
    this.httpService.insertRouteReview(review);
  </code></pre>
  
  <p>}</p>
  
  <p>The review form is just form created in typescript and its working fine. If I dump values (or review object) I can see the proper values.</p>
  
  <p>E: I subscribed to the post and now Its working fine. Thank you</p>