OBJECTIVE:
I'm using GWT and trying to call an existing Twitter REST Service using RestyGWT client
PROBLEM:
I am not receiving a response to my GET request to "https://api.twitter.com/1.1/statuses/mentions_timeline.json"
THINGS I'VE TRIED:
I've looked at RestyGWT's documentation, and I couldn't come across a concrete example on how to call third party REST services. Tried calling a REST service using plaintext return types, same problem. There must be something I'm doing wrong on a fundamental leve.
CODE:
Here's my onModuleLoad:
public void onModuleLoad() {
Resource r = new Resource("https://api.twitter.com/1.1/statuses/mentions_timeline.json");
r.get().send(new JsonCallback() {
@Override
public void onSuccess(Method method, JSONValue response) {
System.out.println("Twitter response:\tYES");
}
@Override
public void onFailure(Method method, Throwable exception) {
System.out.println("Twitter response:\tNO");
System.out.println("Exception:\t\t"+exception.toString());
System.out.println("Exception Message:\t"+exception.getMessage());
System.out.println("Status code:\t\t"+method.getResponse().getStatusCode() );
}
});
}
OUTPUT:
GWT MODULE LOADED
Twitter response: NO
Exception: org.fusesource.restygwt.client.FailedStatusCodeException:
Exception Message:
Status code: 0