Try calling client.access, instead of client.invoke.  The invoke
method is intended for requesting OAuth tokens, not accessing
protected resources.

On Jul 9, 3:43 pm, Siahm <siahm....@gmail.com> wrote:
> Hello I am trying to upload a file with OAuth and I can´t. I get error
> 500 or 200, but I am looking for 201 response. I am using this code:
>
> ...
> params.put("param01", "value01");
>
> aouthRequest = access.newRequestMessage(method, baseUrl,
> params.entrySet(), new FileInputStream(file));
>
> aouthRequest.getHeaders().add(new OAuth.Parameter("Content-Length",
> String.valueOf(file.length())));
>
> //Validation is ok at this point
> aouthRequest.validateMessage(access, new SimpleOAuthValidator());
>
> OAuthMessage rs = client.invoke(aouthRequest,
> net.oauth.ParameterStyle.AUTHORIZATION_HEADER);
> ....
>
> I have checked the oauth_ parameters and they are right. I have also
> try to put content type headers and it fails.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OAuth" group.
To post to this group, send email to oauth@googlegroups.com
To unsubscribe from this group, send email to oauth+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/oauth?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to