I want to get information with the geoCodeStr.
I tried this string with my browser and get information which you can see under the HTTP request code.
The problem of my project is that I get no response.
The status code is 0.
Thanks.
requestBuilder = new RequestBuilder(RequestBuilder.GET, geoCodeStr);
try {
requestBuilder.sendRequest(null,
new RequestCallback() {
public void onError(Request request, Throwable exception) {
Window.alert("Request timeout or no connection to server: "
+ exception.getMessage());
}
public void onResponseReceived(Request request,
Response response) {
System.out.println(response.getHeadersAsString());
System.out.println(response.getText());
if (200 == response.getStatusCode()) {
System.out.println(response.getText());
} else {
Window.alert(""+response.getStatusText());
}
System.out.println(Integer.toString(response.getStatusCode()));
}
});
} catch (RequestException e) {
Window.alert("No connection with server: "+e.getMessage());
}
}
{
"results" : [
{
"address_components" : [
{
"long_name" : "1600",
"short_name" : "1600",
"types" : [ "street_number" ]
},
{
"long_name" : "Amphitheatre Pkwy",
"short_name" : "Amphitheatre Pkwy",
"types" : [ "route" ]
},
...