add clear

This commit is contained in:
as2252258@163.com
2019-12-25 16:32:54 +08:00
parent 9f87d4f8f9
commit 224bd81184
+4
View File
@@ -416,8 +416,12 @@ class HttpClient
curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POST, 1);
} }
if ($this->method != self::GET) { if ($this->method != self::GET) {
if (!empty($this->_data)) {
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->_data);
} else {
curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
} }
}
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($this->method)); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($this->method));
$output = curl_exec($ch); $output = curl_exec($ch);