Permalink
Browse files

MDL-34290 oauthlib_helper support for POST request

  • Loading branch information...
1 parent a6b0ac5 commit 1d168fbd5f787d89bf2a614e1649c109f5d86678 @marinaglancy marinaglancy committed Aug 7, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/oauthlib.php
View
@@ -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

0 comments on commit 1d168fb

Please sign in to comment.