I have a service that responses HTTP Status Code 302 Found. When calling it with RequestBuilder.send() I get redirected automatically, so that the final URL is not equal to the URL initially set for the RequestBuilder.
I need at least the URL the service wants to forward me, in other words the Location header of the first response.
Is it possible to prevent the request from being forwarded? Or can I examine the URL with the final Response?
Probably not. RequestBuilder is implemented as XMLHttpRequest, which does not give any feedback on redirects.
Take a look at Prevent redirection of Xmlhttprequest for details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With