Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Catch "302 Found" when using GWT RequestBuilder

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?

like image 792
Ethan Leroy Avatar asked Jun 24 '26 06:06

Ethan Leroy


1 Answers

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.

like image 102
Wesley Avatar answered Jun 25 '26 21:06

Wesley