I’m having a strange problem using PHP’s OAuth PECL library – I seem to be unable to get it to make requests via GET.
I’m using v1.0.0.
This is the request:
$oauth = new OAuth(
$network->get_consumer_key(),
$network->get_consumer_secret(),
OAUTH_SIG_METHOD_HMACSHA1,
OAUTH_AUTH_TYPE_FORM
);
$oa->enableDebug();
$oauth->setToken('<token>', '<secret token>');
$oauth->fetch('<protected url>', array(), OAUTH_HTTP_METHOD_GET, array("User-Agent" => "pecl/oauth"));
Yet the result I get is:
[debugInfo] => Array
(
[sbs] =>
[headers_sent] => POST HTTP/1.1
...
… it uses POST every time. The OAUTH_HTTP_METHOD_GET constant is set to the string GET.
Any ideas?
I believe that
OAUTH_AUTH_TYPE_FORMin your constructor forces it to do a POST, and not a GET. See here for more info: http://www.php.net/manual/en/oauth.setauthtype.php