On Oct 13, 2010, at 6:41 PM, spidaman wrote: > We've been working with a ruby client (uses the latest gem from > http://github.com/oauth/oauth-ruby) that hits an API implemented with > the php library at http://oauth.googlecode.com/svn/code/php/OAuth.php > integrated in. > > Normal GETs and POSTs seem to work fine but theres a file upload API > we're trying to work out but haven't yet figured out a way to get the > ruby Net::HTTP requests signed in way that the php OAuth server will > accept. I'm not clear on what the accept practice is here. > > Example I've looked thus far have been ineffective: > * http://wiki.openstreetmap.org/wiki/OAuth/Examples > * http://github.com/archiloque/rest-client > ...the signature is always rejected by the php library. > > Has anyone else figured how to get multipart POSTs posted to that php > library to signed acceptably and post some code?
I've managed to get the JS library to sign requests for the PHP library, yeah. The main thing to be careful of is that the PHP library ignores all POST arguments if the content-type of the request isn't application/x-www-form-urlencoded (as per the spec) The content-type likely wont be with file-uploads, because you are likely to have multipart encoded those So what I did was transfer all the parameters I wanted transferred as eitherGET or header parameters, and then have the POST-body contain the file which is then unsigned -Morten (Maintainer of the PHP library in question) > > -- > 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. > > -- 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.
