I've encountered an issue while trying to access headers from a request in Angular. Strangely, the response only includes a link: https://i.sstatic.net/hrLdy.png
Oddly enough, when I copy the request as cURL and run it, the headers are present.
Here is the request code snippet:
login(email, password): Observable<string> {
const url = Utils.baseBackendUrl + '/login';
const headers = new HttpHeaders({
'Content-Type': 'application/json',
});
const httpOptions = {
observe: 'response',
// method: 'POST',
// headers: headers,
};
this.http.post<any>(url, {
user_email: email,
user_password: password,
locale: 'cs_CZ'
}, {headers: headers, observe: 'response'})
.subscribe(resp => {
console.log(resp.headers);
});
return of('ahoj');
}