GWT web application trying to get json from PHP

I have a GWT application and I use RequestBuilder to get some json get from php script I have a Fatcow.com server. It returns json just fine in the browser and returns status 200 in the Charles debugging proxy, but in the GWT application it always says that the response status is 0 and does not give me any json. When I test my code at a known working url, it returns 200 and I get the json I expect. In addition, I already have a header ('Content-Type: application / json; charset = utf-8'); in my php, which I know is a common mistake. Is there a reason this will not work? Is this a php thing, or am I doing something wrong?

0
source share
1 answer

You are in a policy of the same origin .

CORS is supported in recent browsers (exceptions: IE and Opera, will come in IE 10 and Opera 12 respectively).

Only viable alternatives to JSONP (using JsonpRequestBuilder in GWT) or "proxies" on the same server serving your GWT application.

+1
source

All Articles