add clear
This commit is contained in:
@@ -623,7 +623,7 @@ class HttpClient
|
||||
private function curl($url, $data = [])
|
||||
{
|
||||
try {
|
||||
$output = $this->curlParse($url, $this->mergeParams($data));
|
||||
$output = $this->curlParse($url, $data);
|
||||
if ($output === FALSE) {
|
||||
return new Result(['code' => 500, 'message' => $output]);
|
||||
}
|
||||
@@ -680,9 +680,10 @@ class HttpClient
|
||||
if ($this->method == self::POST) {
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
}
|
||||
|
||||
if ($this->method != self::GET) {
|
||||
if ($this->method == self::GET || !empty($this->_data)) {
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
|
||||
} else {
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->mergeParams($data));
|
||||
}
|
||||
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($this->method));
|
||||
|
||||
Reference in New Issue
Block a user