Bugfix: If you make a GET request after a PUT request you still have the PUT value for CURLOPT_CUSTOMREQUEST, causing an error.

I have forced CURLOPT_CUSTOMREQUEST to 'GET' on get requests to avoid header overriding.
This commit is contained in:
Gotardo González
2014-02-27 17:53:09 +01:00
parent 1c91d9d1a5
commit dc51340809
+2
View File
@@ -46,6 +46,7 @@ class Curl {
}
public function get($url_mixed, $data=array()) {
$this->setOpt(CURLOPT_CUSTOMREQUEST, 'GET');
if (is_array($url_mixed)) {
$curl_multi = curl_multi_init();
$this->_multi_parent = true;
@@ -90,6 +91,7 @@ class Curl {
public function post($url, $data=array()) {
$this->setOpt(CURLOPT_URL, $this->_buildURL($url));
$this->setOpt(CURLOPT_CUSTOMREQUEST, 'POST');
$this->setOpt(CURLOPT_POST, true);
$this->setOpt(CURLOPT_POSTFIELDS, $this->_postfields($data));
return $this->exec();