add clear
This commit is contained in:
@@ -282,7 +282,7 @@ class HttpClient
|
||||
{
|
||||
$data = $this->paramEncode($data);
|
||||
if ($this->use_swoole) {
|
||||
return $this->coroutine($this->host, $this->matchHost($url), $data);
|
||||
return $this->coroutine($this->matchHost($url), $data);
|
||||
} else {
|
||||
return $this->useCurl($url, $data);
|
||||
}
|
||||
@@ -452,16 +452,15 @@ class HttpClient
|
||||
|
||||
|
||||
/**
|
||||
* @param $ip
|
||||
* @param $url
|
||||
* @param array $data
|
||||
* @return array|mixed|Result
|
||||
* @throws \Exception
|
||||
* 使用swoole协程方式请求
|
||||
*/
|
||||
private function coroutine($ip, $url, $data = [])
|
||||
private function coroutine($url, $data = [])
|
||||
{
|
||||
$client = $this->generate_client($ip, $url, $data);
|
||||
$client = $this->generate_client($this->host, $url, $data);
|
||||
if ($client->statusCode < 0) {
|
||||
throw new \Exception($client->errMsg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user