javascript - Angular 5 - How to redirect to an external url with specific headers? - Stack Overflow

This is what I am trying to achieve with Angular :this.headers = ...;this.http.get(`${urlApi}`).subscri

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.

Share Improve this question asked Dec 19, 2017 at 8:03 br.julienbr.julien 3,4602 gold badges27 silver badges44 bronze badges 1
  • 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
Add a ment  | 

1 Answer 1

Reset to default 5

From 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&param2=value2&param3=value3 /// etc.

At the end of your URL.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745466741a4628948.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信