Angular2 watch for 302 redirect when fetching resource

If the server sends a redirect with a 302 status code with the URL to redirect within a Location header, the redirect is automatically handled by the browser, i.e. a request to this URL is executed.

That’s why XHR (and the Angular2 wrapper around it, i.e. the Http class) won’t see the result of the first request but only the response of the second one.

Leave a Comment