themattharris / tmhOAuth

An OAuth 1.0A library written in PHP
Apache License 2.0
855 stars 335 forks source link

Update curl options to handle methods beyond GET and PUT #176

Closed jamesvl closed 10 years ago

jamesvl commented 10 years ago

Now handles PUT (and DELETE) type requests as well, which are required for some Twitter API calls. Tested with PUT calls to Twitter API and it works successfully.

Also sets a default 'method' in the default options, just for reference's sake.

themattharris commented 10 years ago

thanks for this. i'll take a closer look into this in the next week and verify for my own satisfaction that this abides by the RFCs. my other hesitation is around the change at line 782 - namely that i'm not clear that it should be there or needed.

jamesvl commented 10 years ago

Thanks for considering it. The change around line 782 is actually the critical part that tells curl to use something other than GET or POST.

For reference, see the PHP manual (of course) or this answer from SO

themattharris commented 10 years ago

merging your changes into the 0.8.4 branch but doing a bit of refactoring with it too. this will be in 0.8.4

themattharris commented 10 years ago

0.8.4 is now merged to master with your changes, and a little refactoring, in it.