I am executing a web service using httpClient, but my problem is that the response headers are always empty, I already check this and this and can't make it work, this is my service:
iniciarSesion(usuario: Usuario) {
const idSistema = environment.idSistema;
const url = environment.url + environment.mssesiones;
return this.httpClient.post(
url,
{
usuario: usuario.usuario,
contrasena: usuario.contrasena,
idSistema: idSistema
},
{
headers: new HttpHeaders({
'Content-Type': 'application/json'
}),
observe : 'response'
});
}
And this is the component that execute the service:
this.inicioSesionService.iniciarSesion(usuario).subscribe(
(httpResponse: HttpResponse<Object>) => {
console.log(httpResponse);
});
Can someone help me with this issue?,
Thanks in advance.