add clear

This commit is contained in:
2020-11-25 18:32:11 +08:00
parent 6fd5e530fb
commit 8d9c41b9e2
+2 -5
View File
@@ -677,15 +677,12 @@ class HttpClient
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);// 跟踪重定向 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);// 跟踪重定向
curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate'); 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)); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($this->method));
if ($this->method === self::GET && !empty($this->_data)) { 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) { if ($this->method === self::POST) {
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->mergeParams($data)); curl_setopt($ch, CURLOPT_POSTFIELDS, $this->mergeParams($data));
} }