admin管理员组文章数量:1430151
This is what I am trying to achieve with Angular :
this.headers = ...;
this.http.get(`${urlApi}`).subscribe(data => {
// go to url with specific headers
}, err => {
console.log(err);
});
When I get the response of a get request from my server, I want to redirect to an external url with specific headers, to be able municate some information between two apps.
There must be a way to do this. I know it's not possible using window.location.href
.
This is what I am trying to achieve with Angular :
this.headers = ...;
this.http.get(`${urlApi}`).subscribe(data => {
// go to url with specific headers
}, err => {
console.log(err);
});
When I get the response of a get request from my server, I want to redirect to an external url with specific headers, to be able municate some information between two apps.
There must be a way to do this. I know it's not possible using window.location.href
.
- I also need to know how to send the headers while calling external urls. Let me know if you got it how to do it. Thanks. – Surya Commented Jun 25, 2021 at 7:44
1 Answer
Reset to default 5From what I have learnt, this is a redirection, not a request : this means you can't add headers to your redirect.
But, what you can do, is send URL params to your second application.
In your URL, simply append
?param1=value1¶m2=value2¶m3=value3 /// etc.
At the end of your URL.
本文标签: javascriptAngular 5How to redirect to an external url with specific headersStack Overflow
版权声明:本文标题:javascript - Angular 5 - How to redirect to an external url with specific headers? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745466741a2659564.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论