title: 415 Unsupported Media Type; Angular2 to API
body: <p>i am new to angular 2 and i'm facing a problem which i cant find a solution:
  When i try to post from angular 2 to API i get - 415 unsupported media type.</p>
  
  <p>Angular 2 code: </p>
  
  <pre><code> onSubmit(value: any) {
      // console.log(value.message);
      let headers = new Headers({ 'Content-Type': 'application/json'});
      let options = new RequestOptions({ headers: headers });
      let creds = 'statusuknown';
      let body = JSON.stringify(creds);
      this.http.post('http://localhost:1318/api/ActionItem', creds)
        .subscribe(
          () =&gt; {console.log('Success')},
          err =&gt; {console.error(err)}
        );
    }
  </code></pre>
  
  <p>And my controller code:</p>
  
  <pre><code> // POST api/actionitem
          [HttpPost]
          public ActionItem Post( [FromBody]string str)// _id, string _status)
          {
              ActionItem item = new ActionItem( 313, str);
              return item;
          }
  </code></pre>
  
  <p>when i change the controller code to not get data from body it works but refers NULL.</p>
  
  <p>My API call screenshot:
  <a href="https://i.stack.imgur.com/E1Kwa.png" rel="noreferrer"><img src="https://i.stack.imgur.com/E1Kwa.png" alt="enter image description here"></a>
  Please help &amp; let me know if more details needed.</p>