Skip to content
Snippets Groups Projects
Commit a3c8846f authored by danb1974's avatar danb1974 Committed by GitHub
Browse files

Clear leftover CURL options from previous request

parent f0998722
Branches
No related merge requests found
......@@ -475,6 +475,20 @@ class Client
return $this;
}
/**
* Unset a cURL option.
*
* @param int $option The CURLOPT_XXX option to unset
*
* @return Client
*/
public function unsetCurlOption($option)
{
unset($this->curlOptions[$option]);
return $this;
}
/**
* Get all set cURL options.
*
......@@ -549,6 +563,9 @@ class Client
// Set the HTTP request headers
$this->setCurlOption(CURLOPT_HTTPHEADER, $httpHeader);
$this->unsetCurlOption(CURLOPT_CUSTOMREQUEST);
$this->unsetCurlOption(CURLOPT_POST);
$this->unsetCurlOption(CURLOPT_POSTFIELDS);
switch ($method) {
case 'POST':
$this->setCurlOption(CURLOPT_POST, 1);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment