MDL-34290 Allow to have several requests to the same instance of oauth_helper

This commit is contained in:
Marina Glancy
2012-08-29 13:12:04 +08:00
parent 120300fb99
commit a6b0ac5362
2 changed files with 10 additions and 0 deletions
+7
View File
@@ -2898,6 +2898,13 @@ class curl {
unset($this->options['CURLOPT_FILE']);
}
/**
* Resets the HTTP Request headers (to prepare for the new request)
*/
public function resetHeader() {
$this->header = array();
}
/**
* Set HTTP Request Header
*
+3
View File
@@ -289,6 +289,9 @@ class oauth_helper {
$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
$this->http->resetHeader();
// return request return value
return $content;
}