I need some help, I don't know how but all my http.put
and http.delete
request from my angular's client are changing in http.options
.
The only error that I have is:
ERROR Object { headers: Object, status: 0, statusText: "Unknown Error", url: null, ok: false, name: "HttpErrorResponse", message: "Http failure response for (unknown …", error: error }
If someone has an idea, thanks to answer me.
Have a nice day
let header = new HttpHeaders({
'Access-Control-Allow-Credentials':'true',
'Access-Control-Allow-Origin' : '*',
'Access-Control-Allow-Headers' : 'Origin, X-Requested-With, Content-Type, Accept'
});
this.http
.put('http://localhost:1993/pays/'+this.codeNouveauPays, JSON.stringify(""), {
headers : header,
params : new HttpParams().set('nom', this.nomNouveauPays).set('code', this.codeNouveauPays)
})
.subscribe();