MDL-34290 oauthlib_helper support for POST request
This commit is contained in:
+5
-1
@@ -286,7 +286,11 @@ class oauth_helper {
|
||||
}
|
||||
// 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
|
||||
|
||||
Reference in New Issue
Block a user