Skip to content

Commit

Permalink
MDL-34290 oauthlib_helper support for POST request
Browse files Browse the repository at this point in the history
  • Loading branch information
marinaglancy committed Aug 29, 2012
1 parent 7e1e775 commit 6ec6842
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/oauthlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,11 @@ public function request($method, $url, $params=array(), $token='', $secret='') {
}
// to access protected resource, sign_secret will alwasy be consumer_secret+token_secret
$this->sign_secret = $this->consumer_secret.'&'.$secret;
$oauth_params = $this->prepare_oauth_parameters($url, array('oauth_token'=>$token), $method);
if (strtolower($method) === 'post' && !empty($params)) {
$oauth_params = $this->prepare_oauth_parameters($url, array('oauth_token'=>$token) + $params, $method);
} else {
$oauth_params = $this->prepare_oauth_parameters($url, array('oauth_token'=>$token), $method);
}
$this->setup_oauth_http_header($oauth_params);
$content = call_user_func_array(array($this->http, strtolower($method)), array($url, $params, $this->http_options));
// reset http header and options to prepare for the next request
Expand Down

0 comments on commit 6ec6842

Please sign in to comment.