Merge branch 'master' of https://github.com/gotardo/php-curl-class into gotardo-master

* 'master' of https://github.com/gotardo/php-curl-class:
  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:
Zach Borboa
2014-03-01 02:24:09 -08:00
+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();