diff --git a/common/HttpClient.php b/common/HttpClient.php index 0411b4c..dbc7ca1 100644 --- a/common/HttpClient.php +++ b/common/HttpClient.php @@ -219,11 +219,14 @@ class HttpClient $data = $this->paramEncode($data); if ($this->use_swoole === false) { return $this->useCurl($url, $data); - } - if (function_exists('getIsCli') && getIsCli()) { + } else if ($this->use_swoole) { return $this->coroutine($this->parseUrlHost($url), $url, $data); + } else { + if (function_exists('getIsCli') && getIsCli()) { + return $this->coroutine($this->parseUrlHost($url), $url, $data); + } + return $this->useCurl($url, $data); } - return $this->useCurl($url, $data); } /** @@ -431,7 +434,6 @@ class HttpClient $data = new Result(['code' => 500, 'message' => curl_error($ch)]); } else { [$header, $body, $status] = $this->explode($output); - if ($status != 200) { $data = new Result(['code' => 500, 'message' => $body, 'header' => $header]); } else {