title: Pass object in POST method from Angular
body: <p>I'm new with angular and i try to consume a post method of a WCF.
  For this i use HttpClient from '@angular/common/http'</p>
  
  <p>My rest service has this sign</p>
  
  <pre><code>[OperationContract]
      [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json, UriTemplate = "SaveUser")]
      String SaveUser(User user);
  </code></pre>
  
  <p>My user class is really simple with firstname, lastname, ... and in my SaveUser method i register user in DB.</p>
  
  <p>Now in my ionic project i have this in my provider but i receive: 405 (Method Not Allowed)
  If i pass JSON.stringify(data) instead of data i get back an error 400 bad request.</p>
  
  <pre><code>console.log(JSON.stringify(data));
  var url = this.apiURL + "/SaveUser";
  return new Promise((resolve, reject) =&gt; {
    this.http.post(url, data)
      .subscribe(res =&gt; {
        resolve(res);
        console.log(res);
      }, (err) =&gt; {
        console.log(err);
        reject(err);
      });
  });
  </code></pre>
  
  <p>For info here is a console.log of data</p>
  
  <pre><code>{"City":"Liege","Email":"test@gmail.com","Firstname":"florine","IsAdmin":false,"Lastname":"detry","Mobile":"0498/123456","Password":"1234","Phone":"","Street":"avenue jean 7","UserID":2,"Zipcode":"4000"}
  </code></pre>
  
  <p>I added chrome extension: Allow-Control-Allow-Origin: * and get response works correctly</p>
  
  <p>I show you a printscreen from the console in Chrome when i try a post.
  <a href="https://i.stack.imgur.com/7TY9z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7TY9z.png" alt="enter image description here"></a></p>