开发者

Gwt and php rpc

开发者 https://www.devze.com 2023-04-04 15:14 出处:网络
I am using gwt with php. I am trying to get data fom the http://typing.lc/userInfo.php url. but the following code returns nothing, but response.getText() is 200, however when i ask http://typing.l

I am using gwt with php.

I am trying to get data fom the http://typing.lc/userInfo.php url. but the following code returns nothing, but response.getText() is 200, however when i ask http://typing.lc/userInfo.php through browser it returns value.

        try
    {
        RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, "http://typing.lc/userInfo.php");
        builder.setHeader("Content-Type", "application/x-www-form-urlencoded");
        builder.sendRequest("", new RequestCallback()
        {
            @Override
            public void onError(Request request, Throwable exception)
            {
       开发者_StackOverflow中文版         Window.alert("Error");
            }

            @Override
            public void onResponseReceived(Request request, Response response)
            {
                Window.alert("Success: " + response.getText());

            }
        });
    }
    catch (RequestException e)
    {
        Window.alert("Exception");
    }


You are probably running into a SOP (Same Origin Policy) issue. See here for possible solutions.

0

精彩评论

暂无评论...
验证码 换一张
取 消