Re: RequestBuilder
Hi,
different ports are indeed an issue, see SOP http://en.wikipedia.org/wiki/Same_origin_policy...
I tried your code here and got a status code 0.
For test purposes, dump your response data into your war folder and
change the url to the new location.
If it works, it is not your code, it most probably is SOP.
brgds,
Papick
ps: I use GWT.log("Got status code " + response.getStatusCode(), null)
to log instead of Window.alert.
On 9 Dez., 16:22, charlie <charlie.f...@gmail.com> wrote:
> I have a php pagehttp://the-charlie.com/artwork/index.php?artist=Kanye+West&album=Grad...,
> that when I hit it directly gives me an image URL.
>
> I have this code in my app
>
> RequestBuilder builder = new RequestBuilder(RequestBuilder.GET,"http://the-charlie.com/artwork/index.php?artist=Kanye+West&album=Grad..."
> );
>
> try {
> builder.sendRequest("", new RequestCallback() {
>
> @Override
> public void onResponseReceived(Request request,
> Response response) {
>
> Window.alert(response.getText() );
> Window.alert(response.getHeadersAsString());
> Window.alert(response.getStatusText() );
>
> Window.alert(Integer.toString(response.getStatusCode()));
> }
>
> @Override
> public void onError(Request request, Throwable
> exception) {
>
> }
> });
> } catch (RequestException e) {
>
> e.printStackTrace();
> }
>
> }
>
> Which is always returning null , with a status code of 200.
>
> If my app runs on port 8080, is it a problem hitting a page on port 80 ( the
> php page ) ?
>
> Why would this constantly be returning blank ?
>
> Thanks!
> Charlie
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home