I'm interacting with a Laravel API from Angular 7.2 component, all methods works fine except delete, I can see thru Firefox network activity console that when trigger the function, the request is sent with OPTIONS method.
This is my service method:
elimina( id:number ) {
return this._http.delete( this.apiFMX + '/users/' + id );}
And in my component:
eliminaElemento( id:number ) {
this.dataService.elimina( id ).subscribe();
this.ruta.navigateByUrl( '/fmx-listado' );}
But it doesn´t work, here the console output:
Aditional I have added Cors Middleware in my Laravel API. Also, if the request is edited in the firefox console updating OPTIONS to DELETE method, it works.
Any suggestion?
Thanks in advise.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire