415 Unsupported Media Type; Angular2 to API 415 Unsupported Media Type; Angular2 to API angular angular

415 Unsupported Media Type; Angular2 to API


enter image description hereYou defined headers, but didn't use it. Change your code to

this.http.post('http://localhost:1318/api/ActionItem', body, options).map(response => response.json())      .subscribe(        () => {console.log('Success')}      );


use header and body also in http request. in cread use value parameter of onSubmit function.

use following code

let creds=JSON.Stringify(value);this.http.post('http://localhost:1318/api/ActionItem', creds, options)     .map((res: Response) => res.json()).subscribe(res => {       this.result = res;       console.log(this.result);     });