ext-swooleis supported until v4.7.1, use
ext-openswoole>= v4.7.1. Latest version:
pecl install openswoole-4.9.1
<?php Swoole\Coroutine\Http2\Client->send(Swoole\Http2\Request $request): int|bool
Returns an integer starting from 1, if the return flow is of an odd increment it means something went wrong with the previous send operation or
false is returned when the request cannot be sent at all. Check
$client->errCode for more details.
Send a request to the server, automatically establishing a HTTP/2 stream for you. Multiple requests can be initiated at the same time.
This method expects a
Swoole\Http2\Request object, you build up this object before you call
send(), this is what the client will use when sending the request to the remote host, based on the settings within the object given.
Swoole\Http2\Request object does not have any methods, only public class properties which you can set to build a request you want to send. To learn more about the request object, check its documentation.
Check the main Quick Start Examples to see how the
send() method is used in its full context.