Answer the question
In order to leave comments, you need to log in
How to get header value in server response on Angular Http Client?
The server, in addition to the data, responds with an additional data_count parameter in the headers How do I get this parameter when making a request?
I try like this but it doesn't work
this.http.post<any>('Server/api/',{}
).subscribe((res: Response) => {
console.log(res.headers.get('data_count'));
}
Answer the question
In order to leave comments, you need to log in
By default, the request returns json.
Enter observe: "response"
in the request options. Third argument
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question