Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 2 http delete doesn't make network requests

Tags:

http

angular

Other verbs work fine to my api but delete doesn't fire anything in the network tab on chrome Dev tools

like image 724
Peter Short Avatar asked Apr 06 '16 17:04

Peter Short


1 Answers

I guess that you forgot to subscribe on the request. Observables are lazy so you need to subscribe to actually execute them. It must be done even if you don't expect a payload in the response.

Something like that:

this.http.delete().subscribe((res) => {
});
like image 125
Thierry Templier Avatar answered Sep 28 '22 10:09

Thierry Templier