add clear
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user