Closed coding-lover closed 1 year ago
` go(function() {
/** @var HttpClient $client */ //$client = ContextManager::getInstance()->get(HTTP_CLIENT_HANDLER); $client = new HttpClient(); if(!Tools::isOnline()) { $client->setEnableSSL(true); $client->setProxyHttp('127.0.0.1', '6666'); } $client->setUrl("https://api.huobi.pro/market/detail/merged?symbol=ltcusdt"); $response = $client->get(); var_dump($response->getBody()); //这次 setUrl 不生效 $client->setUrl("https://api.huobi.pro/market/detail/merged?symbol=btcusdt"); $response = $client->get(); var_dump($response->getBody()); });
`
[2020-03-26 11:13:22][DEBUG][WARNING] : [Swoole\Coroutine\Http\Client::execute(): path is empty at file:/data/www/kit/vendor/easyswoole/http-client/src/HttpClient.php line:527]
http-client不建议复用 socket已经连接上 你换了host是不行的 如果针对同一host机器 修改那么没问题
您好,您发的邮件我已收到,谢谢。
` go(function() {
`
[2020-03-26 11:13:22][DEBUG][WARNING] : [Swoole\Coroutine\Http\Client::execute(): path is empty at file:/data/www/kit/vendor/easyswoole/http-client/src/HttpClient.php line:527]