3

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?

Ethan Leroy
  • 15,804
  • 9
  • 41
  • 63

1 Answers1

3

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.

Community
  • 1
  • 1
Wesley
  • 10,652
  • 4
  • 37
  • 52