Hi John,

I think in the end, this would make development much easier.  Although
it does put the responsibility of error handling on the developer, I
think this is better in the longrun as the magic way of doing it might
not always be how the developer wants to handle it.  For example, at
the moment I'm still having issues getting the upload stuff to work,
and I think this change might end up making that a lot easier.

On Jan 31, 1:59 am, John Kristian <[email protected]> wrote:
> I propose to extend the Java oauth-core library to better support
> accessing protected resources, as follows.  Please let me know if this
> is a bad idea, or there's a better way.
>
> In brief, I propose to add a method to OAuthClient:
>
> /** Send a request and return the response. */
> public OAuthResponseMessage access (OAuthMessage request,
> ParameterStyle style) throws IOException;
>
> Unlike the existing 'invoke' method, it won't try to decide whether
> the response indicates success; it will merely return the response.  A
> typical caller would evaluate the response, something like this:
>
> OAuthClient client = ...;
> OAuthAccessor accessor = ...;
> OAuthMessage request = new ...;
> request.addRequiredParameters (accessor);
> OAuthResponseMessage response = client.access (request,
> ParameterStyle.AUTHORIZATION_HEADER);
> switch(response.getHttpResponse().getStatusCode()) {
>   case 200: ...
>   case 400: ...
>
> I'm a little worried about feature creep: this is a step toward a
> general purpose HTTP client library.  But it's a tolerably small step,
> I hope.  I don't want to try to reproduce all the features of the
> Apache HTTP client libraries.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to