After switching to Angular 2 Release, I started using Http and Headers from @angular/http. Everything seemed to be working fine as I called verbs like POST, GET, and PUT. However, I ran into an issue when trying to use the "DELETE" verb.
Here is a snippet of my code:
remove(url:string, id:any) {
let headers = new Headers();
headers.append('Authorization': 'Bearer ' + this.token);
return this.http.delete(url, {
headers: headers;
body: { id: id }
}).map(response => response.json());
}
The response I received stated that the requested resource does not support the http method 'delete'.
In my controller, the method looks something like this:
[HttpDelete]
public Task<HttpResponseMessage> Delete(int id)
{
//..
}
I would appreciate any assistance in resolving this issue. Thank you!