shop-php/crmeb/utils/AsynClient.php
2024-01-31 11:44:35 +08:00

20 lines
366 B
PHP

<?php
namespace crmeb\utils;
use Swoole\Coroutine\Http\Client;
use function Swoole\Coroutine\run;
class AsynClient
{
function post($host='',$url='',$data)
{
run(function () use($host,$url,$data) {
$cli = new Client($host);
$cli->post($url,$data);
echo $cli->body;
$cli->close();
});
}
}