Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In case anyone comes across this looking for the answer, here is what I found works:</p> <p>To perform a POST OAuth signed request, you need to set the OAuth object to send using POST instead of GET by adding this method before the <code>fetch()</code> method: </p> <pre><code>$oauth-&gt;setAuthType(OAUTH_AUTH_TYPE_FORM); </code></pre> <p>Even if you're using the <code>OAUTH_HTTP_METHOD_POST</code> parameter in the <code>fetch()</code> method, the OAuth instance itself needs to have <code>setAuthType(OAUTH_AUTH_TYPE_FORM)</code> called on it first. </p> <p>The code for the specific example I was citing is:</p> <pre><code> if(!isset($_GET['oauth_token']) &amp;&amp; $_SESSION['state']==1) $_SESSION['state'] = 0; $oauth = new OAuth($rdio_conskey,$rdio_conssec,OAUTH_SIG_METHOD_HMACSHA1,OAUTH_AUTH_TYPE_URI); $oauth-&gt;enableDebug(); if(!isset($_GET['oauth_token']) &amp;&amp; !$_SESSION['state']) { $request_token_info = $oauth-&gt;getRequestToken($rdio_req_url); $_SESSION['secret'] = $request_token_info['oauth_token_secret']; $_SESSION['state'] = 1; header('Location: '.$rdio_auth_url.'?oauth_token='.$request_token_info['oauth_token'].'&amp;oauth_callback='.$callbackurl); exit; } else if($_SESSION['state']==1) { $oauth-&gt;setToken($_GET['oauth_token'],$_SESSION['secret']); $access_token_info = $oauth-&gt;getAccessToken($rdio_acc_url); $_SESSION['state'] = 2; $_SESSION['token'] = $access_token_info['oauth_token']; $_SESSION['secret'] = $access_token_info['oauth_token_secret']; } $oauth = new OAuth($rdio_conskey, $rdio_conssec, OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_URI); $oauth-&gt;setToken($access_token_info['oauth_token'],$access_token_info['oauth_token_secret']); $oauth-&gt;setAuthType(OAUTH_AUTH_TYPE_FORM); $oauth-&gt;fetch($rdio_api_url, array("method" =&gt; "currentUser", "extras" =&gt; "username"), OAUTH_HTTP_METHOD_FORM); $json = json_decode($oauth-&gt;getLastResponse()); print_r($json); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload