What is the value of $query, $url and the Signature Base String? On a related note, take a look at:
http://cvs.php.net/viewvc.cgi/pecl/oauth/examples/twitter/ You can call OAuth::enableDebug() and inspect debugInfo member which will give you the in/out/sbs thereby allowing you to compare your results against pecl/oauth (which works). http://us2.php.net/manual/en/oauth.enabledebug.php Regards, John On Fri, May 29, 2009 at 7:54 AM, AlfredN <[email protected]> wrote: > > Hi, I have written code for oauth for a dev i'm doing and i'm having > problems actually posting updates to twitter via Oauth. I have tested > code out with verify credentials and other GET methods and it works > fine however it does not work when I use cURL POST methods in PHP. I > get invalid token/signature error. Is anyone getting these types of > problems specifically when posting status updates? Or is this just me? > Also are there some things I should be doing? Here is my method for a > POST call: > > function httpPost($url,$headers,$data){ > $query = http_build_query($data); > > $ch = curl_init(); > curl_setopt($ch, CURLOPT_URL, $url); > curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); > curl_setopt($ch, CURLOPT_POST, 1); > curl_setopt($ch, CURLOPT_POSTFIELDS, "{$query}"); > curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); > > $result = curl_exec($ch); > curl_close($ch); > > return $result; > } > > > Thanks, I appreciate your help :] >
