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.

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.

本文标签: javascriptAngular 5How to redirect to an external url with specific headersStack Overflow