Answer by Rahmathullah M for How to get value in Response header Angular2
Another solution with Angular 4.2.+; Service getProfile(data) { return this.httpClient .request(new HttpRequest("POST", this.url, {})); } Component this.userService.getProfile().subscribe( (response:...
View ArticleAnswer by Bopsi for How to get value in Response header Angular2
As described here You need to set permission at producer side to access headers as - header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization,...
View ArticleAnswer by mkaj for How to get value in Response header Angular2
This stumped me for an hour. Although Chrome debugger shows the 'Location' header I was unable to read it in angular@4.3.3 using Microsoft.AspNetCore.Mvc 2.0.0 It turns out it was a CORS issue. The fix...
View ArticleAnswer by edkeveked for How to get value in Response header Angular2
One way to solve that issue is to specify from your backend which one of the pairs {key: value} of your headers you want to expose. Using a java backend, you can add the following lines: public void...
View ArticleAnswer by Dr.Tranquility for How to get value in Response header Angular2
The answer is easy, just use the Location from url inside map function .map((data: Response) => { response.url })
View ArticleAnswer by Kanad Chourasia for How to get value in Response header Angular2
.map((res: Response) => { localStorage.setItem('setCookie', res.headers._headers.get("Set-Cookie")[0]); res.json() }) or you can take reference from...
View ArticleAnswer by grueny for How to get value in Response header Angular2
You have to expose the headers on the server-side. Some headers are allowed to access from the client, like content-type, but not all. For more details have a look at paragraph:...
View ArticleAnswer by Thierry Templier for How to get value in Response header Angular2
The problem is that you map your response to its json content. Headers can be reached from the response itself. So you need to remove the map operator: this.http.post(this.loginUrl, JSON.stringify({...
View ArticleHow to get value in Response header Angular2
i want to get session token in response header(Set-Cookie).how can i access values in Response header ? var headers = new Headers(); headers.append('Content-Type', 'application/json');...
View Article
More Pages to Explore .....