\swoole_http2_client

Summary

Methods
Properties
Constants
__construct()
setHeaders()
setCookies()
get()
post()
openStream()
push()
closeStream()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct(string  $host, integer  $port, boolean  $useSSL = false) 

Client constructor.

Parameters

string $host
integer $port
boolean $useSSL

setHeaders()

setHeaders(array  $haders) 

Parameters

array $haders

['key' => 'value']

setCookies()

setCookies(array  $cookies) 

Parameters

array $cookies

['key'=>'value']

get()

get(string  $uri, callable  $callback) : boolean|void

Parameters

string $uri
callable $callback

Returns

boolean|void

post()

post(string  $uri, callable  $callback, mixed  $data) : void|boolean

Parameters

string $uri
callable $callback
mixed $data

Returns

void|boolean

openStream()

openStream(string  $uri, callable  $callback) : integer|boolean|void

Parameters

string $uri
callable $callback

Returns

integer|boolean|void —

return the stream id when success

push()

push(integer  $streamID, mixed  $data) : boolean

push data to server

Parameters

integer $streamID
mixed $data

Returns

boolean

closeStream()

closeStream(integer  $streamID) 

Parameters

integer $streamID