я пытаюсь получить заголовок ответа после http запроса, и я не могу его получить ...
headers: HttpHeaders;
httpOptions;
constructor(private http: HttpClient) {
const token = localStorage.getItem("token");
this.headers = new HttpHeaders({
"Content-Type": "application/x-www-form-urlencoded"
}).set("x-auth-token", token);
this.httpOptions = {
headers: this.headers,
responseType: "text" as "json",
observe: "response"
};}
test<T>(url: string) {
return this.http.get<T>(url, this.httpOptions).pipe(
tap((res: HttpResponse<any>) => {
console.log(res.headers.keys())
}))
}
я пытаюсь получить это: заголовок