OAuthAccessor.newRequestMessage merely constructs an OAuthMessage,
which is merely a passive object. The message has no body;
consequently readBodyAsString returns null.
To access a protected resource, one must send a message to a service
provider. One can call OAuthClient.invoke, or use some other library
to send an HTTP request. For example:
OAuthMessage result = client.invoke(accessor,
OAuthMessage.GET,
"http://brightkite.com/places/search.json",
OAuth.newList("q", latitude + "," + longitude));
String result_message = result.readBodyAsString();
On Jan 14, 3:38 pm, Tane Piper <[email protected]> wrote:
> Sorry to bump this again, but I've looked over the examples again, and
> I still cannot see where I am going wrong! I'm still getting an null
> body back when i do:
>
> OAuthMessage result = accessor.newRequestMessage(
> OAuthMessage.GET,
> "http://brightkite.com/places/search.json",
> OAuth.newList("q", myLocation.getLatitude() + "," +
> myLocation.getLongitude()));
> String result_message = result.readBodyAsString();
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"OAuth" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/oauth?hl=en
-~----------~----~----~----~------~----~------~--~---