easy-swoole / http-client

7 stars 15 forks source link

Client::execute(): path is empty #25

Closed coding-lover closed 1 year ago

coding-lover commented 4 years 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]

image

Player626 commented 2 years ago

http-client不建议复用 socket已经连接上 你换了host是不行的 如果针对同一host机器 修改那么没问题

coding-lover commented 2 years ago

您好,您发的邮件我已收到,谢谢。

coding-lover commented 1 year ago

您好,您发的邮件我已收到,谢谢。