Angle 4
Greetings community, I am trying to pass some parameters through the headers in a post request but it generates an error, it tells me that the parameters are not being sent in the headers, does anyone know what I am doing wrong?
registerHome(user_to_registerHome){
let params = JSON.stringify(user_to_registerHome);
let headers = new Headers({'Content-Type': 'application/json; charset=utf-8;'},{'token':this.getToken});
return this._http.post(this.url+'consolaseguridad-service/createUser', params, {headers: headers})
.map(res => res.json());
}
Expanding on @Findelias' answer, the header
token
doesn't exist, it should look like this:Try this.
If you get any other error, comment it and we will see it.