diff --git a/wchat/common/HttpClient.php b/wchat/common/HttpClient.php index a7a25a0..1c90581 100644 --- a/wchat/common/HttpClient.php +++ b/wchat/common/HttpClient.php @@ -677,15 +677,12 @@ class HttpClient curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);// 跟踪重定向 curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate'); - if ($this->method == self::POST) { - curl_setopt($ch, CURLOPT_POST, 1); - } - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($this->method)); if ($this->method === self::GET && !empty($this->_data)) { - curl_setopt($ch, CURLOPT_POSTFIELDS, $this->toRequest($data)); + curl_setopt($ch, CURLOPT_POSTFIELDS, $this->toRequest($this->_data)); } if ($this->method === self::POST) { + curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $this->mergeParams($data)); }