add clear
This commit is contained in:
+5
-1
@@ -28,6 +28,10 @@ class Http
|
|||||||
return $this->curl($url, $pushType, $data, $callback, $isSSL);
|
return $this->curl($url, $pushType, $data, $callback, $isSSL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (function_exists('getIsCli') && getIsCli()) {
|
||||||
|
return $this->coroutine($url, $pushType, $data, $callback, $isSSL);
|
||||||
|
}
|
||||||
|
|
||||||
$url = 'https://' . $this->url . '/' . $url;
|
$url = 'https://' . $this->url . '/' . $url;
|
||||||
|
|
||||||
return $this->curl($url, $pushType, $data, $callback, $isSSL);
|
return $this->curl($url, $pushType, $data, $callback, $isSSL);
|
||||||
@@ -37,9 +41,9 @@ class Http
|
|||||||
* @param $url
|
* @param $url
|
||||||
* @param string $type
|
* @param string $type
|
||||||
* @param array $data
|
* @param array $data
|
||||||
* @throws
|
|
||||||
* @return Result
|
* @return Result
|
||||||
* 使用swoole协程方式请求
|
* 使用swoole协程方式请求
|
||||||
|
* @throws
|
||||||
*/
|
*/
|
||||||
private function coroutine($url, $type = 'get', $data = [], callable $callback = NULL, $isSSL = FALSE)
|
private function coroutine($url, $type = 'get', $data = [], callable $callback = NULL, $isSSL = FALSE)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user