Skip to content

HTTP 客户端读取 SSE 数据 #5562

Closed Answered by crystoy
crystoy asked this question in Q&A
Discussion options

You must be logged in to vote

可以使用 write_func 回调(swoole >= 5.1.0)来处理 HTTP CHUNK 数据

$cli = new Swoole\Coroutine\Http\Client('127.0.0.1', 80);
$cli->set(['write_func' => function ($client, $data) {
    var_dump($data);
}]);
$cli->get('/');

https://wiki.swoole.com/zh-cn/#/coroutine_client/http_client?id=write_func

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by crystoy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant