HttpClient

An asynchronous HTTP client.

It allows you to make requests to HTTP servers, and a single client can make requests to any server.

It also allows you to open WebSockets to servers.

The client can also pool HTTP connections.

For pooling to occur, keep-alive must be true on the @see \io\vertx\jphp\core\http\HttpClientOptions (default is true). In this case connections will be pooled and re-used if there are pending HTTP requests waiting to get a connection, otherwise they will be closed.

This gives the benefits of keep alive when the client is loaded but means we don't keep connections hanging around unnecessarily when there would be no benefits anyway.

The client also supports pipe-lining of requests. Pipe-lining means another request is sent on the same connection before the response from the preceding one has returned. Pipe-lining is not appropriate for all requests.

To enable pipe-lining, it must be enabled on the @see \io\vertx\jphp\core\http\HttpClientOptions (default is false).

When pipe-lining is enabled the connection will be automatically closed when all in-flight responses have returned and there are no outstanding pending requests to write.

The client is designed to be reused between requests.

package

Default

Methods

__construct

__construct() 

Close the client. Closing will close down any pooled connections.

close() : void

Clients should always be closed after use.

Set a connection handler for the client. This handler is called when a new connection is established.

connectionHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

a reference to this, so the API can be used fluently

Create an HTTP DELETE request to send to the server with the specified options.

delete( $arg0,  $arg1 = null,  $arg2 = null,  $arg3 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $options [RequestOptions | array] the request options delete($options)

Create an HTTP DELETE request to send to the server at the default host and port.

param $requestURI [string] the relative URI delete($requestURI)

Create an HTTP DELETE request to send to the server at the specified host and default port.

param $host [string] the host param $requestURI [string] the relative URI delete($host, $requestURI)

Create an HTTP DELETE request to send to the server with the specified options, specifying a response handler to receive the response

param $options [RequestOptions | array] the request options param $responseHandler [callable] the response handler this method is deprecated delete($options, $responseHandler)

Create an HTTP DELETE request to send to the server at the default host and port, specifying a response handler to receive the response

param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated delete($requestURI, $responseHandler)

Create an HTTP DELETE request to send to the server at the specified host and port.

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI delete($port, $host, $requestURI)

Create an HTTP DELETE request to send to the server at the specified host and default port, specifying a response handler to receive the response

param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated delete($host, $requestURI, $responseHandler)

Create an HTTP DELETE request to send to the server at the specified host and port, specifying a response handler to receive the response

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated delete($port, $host, $requestURI, $responseHandler)

Arguments

$arg0

string | RequestOptions | array | integer

$arg1

callable | string

$arg2

callable | string

$arg3

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Create an HTTP DELETE request to send to the server using an absolute URI

deleteAbs( $arg0,  $arg1 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $absoluteURI [string] the absolute URI deleteAbs($absoluteURI)

Create an HTTP DELETE request to send to the server using an absolute URI, specifying a response handler to receive the response

param $absoluteURI [string] the absolute URI param $responseHandler [callable] the response handler this method is deprecated deleteAbs($absoluteURI, $responseHandler)

Arguments

$arg0

string

$arg1

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Create an HTTP GET request to send to the server with the specified options.

get( $arg0,  $arg1 = null,  $arg2 = null,  $arg3 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $options [RequestOptions | array] the request options get($options)

Create an HTTP GET request to send to the server at the default host and port.

param $requestURI [string] the relative URI get($requestURI)

Create an HTTP GET request to send to the server at the specified host and default port.

param $host [string] the host param $requestURI [string] the relative URI get($host, $requestURI)

Create an HTTP GET request to send to the server with the specified options, specifying a response handler to receive the response

param $options [RequestOptions | array] the request options param $responseHandler [callable] the response handler this method is deprecated get($options, $responseHandler)

Create an HTTP GET request to send to the server at the default host and port, specifying a response handler to receive the response

param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated get($requestURI, $responseHandler)

Create an HTTP GET request to send to the server at the specified host and port.

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI get($port, $host, $requestURI)

Create an HTTP GET request to send to the server at the specified host and default port, specifying a response handler to receive the response

param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated get($host, $requestURI, $responseHandler)

Create an HTTP GET request to send to the server at the specified host and port, specifying a response handler to receive the response

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated get($port, $host, $requestURI, $responseHandler)

Arguments

$arg0

string | RequestOptions | array | integer

$arg1

callable | string

$arg2

callable | string

$arg3

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Create an HTTP GET request to send to the server using an absolute URI

getAbs( $arg0,  $arg1 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $absoluteURI [string] the absolute URI getAbs($absoluteURI)

Create an HTTP GET request to send to the server using an absolute URI, specifying a response handler to receive the response

param $absoluteURI [string] the absolute URI param $responseHandler [callable] the response handler this method is deprecated getAbs($absoluteURI, $responseHandler)

Arguments

$arg0

string

$arg1

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Sends an HTTP GET request to the server with the specified options, specifying a response handler to receive the response

getNow( $arg0,  $arg1,  $arg2 = null,  $arg3 = null) : $this

param $options [RequestOptions | array] the request options param $responseHandler [callable] the response handler this method is deprecated getNow($options, $responseHandler)

Sends an HTTP GET request to the server at the default host and port, specifying a response handler to receive the response

param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated getNow($requestURI, $responseHandler)

Sends an HTTP GET request to the server at the specified host and default port, specifying a response handler to receive the response

param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated getNow($host, $requestURI, $responseHandler)

Sends an HTTP GET request to the server at the specified host and port, specifying a response handler to receive the response

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated getNow($port, $host, $requestURI, $responseHandler)

deprecated

Arguments

$arg0

string | RequestOptions | array | integer

$arg1

callable | string

$arg2

callable | string

$arg3

callable

Response

$this

a reference to this, so the API can be used fluently

Create an HTTP HEAD request to send to the server with the specified options.

head( $arg0,  $arg1 = null,  $arg2 = null,  $arg3 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $options [RequestOptions | array] the request options head($options)

Create an HTTP HEAD request to send to the server at the default host and port.

param $requestURI [string] the relative URI head($requestURI)

Create an HTTP HEAD request to send to the server at the specified host and default port.

param $host [string] the host param $requestURI [string] the relative URI head($host, $requestURI)

Create an HTTP HEAD request to send to the server with the specified options, specifying a response handler to receive the response

param $options [RequestOptions | array] the request options param $responseHandler [callable] the response handler this method is deprecated head($options, $responseHandler)

Create an HTTP HEAD request to send to the server at the default host and port, specifying a response handler to receive the response

param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated head($requestURI, $responseHandler)

Create an HTTP HEAD request to send to the server at the specified host and port.

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI head($port, $host, $requestURI)

Create an HTTP HEAD request to send to the server at the specified host and default port, specifying a response handler to receive the response

param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated head($host, $requestURI, $responseHandler)

Create an HTTP HEAD request to send to the server at the specified host and port, specifying a response handler to receive the response

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated head($port, $host, $requestURI, $responseHandler)

Arguments

$arg0

string | RequestOptions | array | integer

$arg1

callable | string

$arg2

callable | string

$arg3

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Create an HTTP HEAD request to send to the server using an absolute URI

headAbs( $arg0,  $arg1 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $absoluteURI [string] the absolute URI headAbs($absoluteURI)

Create an HTTP HEAD request to send to the server using an absolute URI, specifying a response handler to receive the response

param $absoluteURI [string] the absolute URI param $responseHandler [callable] the response handler this method is deprecated headAbs($absoluteURI, $responseHandler)

Arguments

$arg0

string

$arg1

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Sends an HTTP HEAD request to the server with the specified options, specifying a response handler to receive the response

headNow( $arg0,  $arg1,  $arg2 = null,  $arg3 = null) : $this

param $options [RequestOptions | array] the request options param $responseHandler [callable] the response handler this method is deprecated headNow($options, $responseHandler)

Sends an HTTP HEAD request to the server at the default host and port, specifying a response handler to receive the response

param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated headNow($requestURI, $responseHandler)

Sends an HTTP HEAD request to the server at the specified host and default port, specifying a response handler to receive the response

param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated headNow($host, $requestURI, $responseHandler)

Sends an HTTP HEAD request to the server at the specified host and port, specifying a response handler to receive the response

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated headNow($port, $host, $requestURI, $responseHandler)

deprecated

Arguments

$arg0

string | RequestOptions | array | integer

$arg1

callable | string

$arg2

callable | string

$arg3

callable

Response

$this

a reference to this, so the API can be used fluently

Whether the metrics are enabled for this measured object

isMetricsEnabled() : boolean

Response

boolean

{@code true} if metrics are enabled

Create an HTTP OPTIONS request to send to the server with the specified options.

options( $arg0,  $arg1 = null,  $arg2 = null,  $arg3 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $options [RequestOptions | array] the request options options($options)

Create an HTTP OPTIONS request to send to the server at the default host and port.

param $requestURI [string] the relative URI options($requestURI)

Create an HTTP OPTIONS request to send to the server at the specified host and default port.

param $host [string] the host param $requestURI [string] the relative URI options($host, $requestURI)

Create an HTTP OPTIONS request to send to the server with the specified options, specifying a response handler to receive the response

param $options [RequestOptions | array] the request options param $responseHandler [callable] the response handler this method is deprecated options($options, $responseHandler)

Create an HTTP OPTIONS request to send to the server at the default host and port, specifying a response handler to receive the response

param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated options($requestURI, $responseHandler)

Create an HTTP OPTIONS request to send to the server at the specified host and port.

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI options($port, $host, $requestURI)

Create an HTTP OPTIONS request to send to the server at the specified host and default port, specifying a response handler to receive the response

param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated options($host, $requestURI, $responseHandler)

Create an HTTP OPTIONS request to send to the server at the specified host and port, specifying a response handler to receive the response

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated options($port, $host, $requestURI, $responseHandler)

Arguments

$arg0

string | RequestOptions | array | integer

$arg1

callable | string

$arg2

callable | string

$arg3

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Create an HTTP OPTIONS request to send to the server using an absolute URI

optionsAbs( $arg0,  $arg1 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $absoluteURI [string] the absolute URI optionsAbs($absoluteURI)

Create an HTTP OPTIONS request to send to the server using an absolute URI, specifying a response handler to receive the response

param $absoluteURI [string] the absolute URI param $responseHandler [callable] the response handler this method is deprecated optionsAbs($absoluteURI, $responseHandler)

Arguments

$arg0

string

$arg1

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Sends an HTTP OPTIONS request to the server with the specified options, specifying a response handler to receive the response

optionsNow( $arg0,  $arg1,  $arg2 = null,  $arg3 = null) : $this

param $options [RequestOptions | array] the request options param $responseHandler [callable] the response handler this method is deprecated optionsNow($options, $responseHandler)

Sends an HTTP OPTIONS request to the server at the default host and port, specifying a response handler to receive the response

param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated optionsNow($requestURI, $responseHandler)

Sends an HTTP OPTIONS request to the server at the specified host and default port, specifying a response handler to receive the response

param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated optionsNow($host, $requestURI, $responseHandler)

Sends an HTTP OPTIONS request to the server at the specified host and port, specifying a response handler to receive the response

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated optionsNow($port, $host, $requestURI, $responseHandler)

deprecated

Arguments

$arg0

string | RequestOptions | array | integer

$arg1

callable | string

$arg2

callable | string

$arg3

callable

Response

$this

a reference to this, so the API can be used fluently

Create an HTTP POST request to send to the server with the specified options.

post( $arg0,  $arg1 = null,  $arg2 = null,  $arg3 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $options [RequestOptions | array] the request options post($options)

Create an HTTP POST request to send to the server at the default host and port.

param $requestURI [string] the relative URI post($requestURI)

Create an HTTP POST request to send to the server at the specified host and default port.

param $host [string] the host param $requestURI [string] the relative URI post($host, $requestURI)

Create an HTTP POST request to send to the server with the specified options, specifying a response handler to receive the response

param $options [RequestOptions | array] the request options param $responseHandler [callable] the response handler this method is deprecated post($options, $responseHandler)

Create an HTTP POST request to send to the server at the default host and port, specifying a response handler to receive the response

param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated post($requestURI, $responseHandler)

Create an HTTP POST request to send to the server at the specified host and port.

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI post($port, $host, $requestURI)

Create an HTTP POST request to send to the server at the specified host and default port, specifying a response handler to receive the response

param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated post($host, $requestURI, $responseHandler)

Create an HTTP POST request to send to the server at the specified host and port, specifying a response handler to receive the response

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated post($port, $host, $requestURI, $responseHandler)

Arguments

$arg0

string | RequestOptions | array | integer

$arg1

callable | string

$arg2

callable | string

$arg3

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Create an HTTP POST request to send to the server using an absolute URI

postAbs( $arg0,  $arg1 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $absoluteURI [string] the absolute URI postAbs($absoluteURI)

Create an HTTP POST request to send to the server using an absolute URI, specifying a response handler to receive the response

param $absoluteURI [string] the absolute URI param $responseHandler [callable] the response handler this method is deprecated postAbs($absoluteURI, $responseHandler)

Arguments

$arg0

string

$arg1

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Create an HTTP PUT request to send to the server with the specified options.

put( $arg0,  $arg1 = null,  $arg2 = null,  $arg3 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $options [RequestOptions | array] the request options put($options)

Create an HTTP PUT request to send to the server at the default host and port.

param $requestURI [string] the relative URI put($requestURI)

Create an HTTP PUT request to send to the server at the specified host and default port.

param $host [string] the host param $requestURI [string] the relative URI put($host, $requestURI)

Create an HTTP PUT request to send to the server with the specified options, specifying a response handler to receive the response

param $options [RequestOptions | array] the request options param $responseHandler [callable] the response handler this method is deprecated put($options, $responseHandler)

Create an HTTP PUT request to send to the server at the default host and port, specifying a response handler to receive the response

param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated put($requestURI, $responseHandler)

Create an HTTP PUT request to send to the server at the specified host and port.

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI put($port, $host, $requestURI)

Create an HTTP PUT request to send to the server at the specified host and default port, specifying a response handler to receive the response

param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated put($host, $requestURI, $responseHandler)

Create an HTTP PUT request to send to the server at the specified host and port, specifying a response handler to receive the response

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated put($port, $host, $requestURI, $responseHandler)

Arguments

$arg0

string | RequestOptions | array | integer

$arg1

callable | string

$arg2

callable | string

$arg3

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Create an HTTP PUT request to send to the server using an absolute URI

putAbs( $arg0,  $arg1 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $absoluteURI [string] the absolute URI putAbs($absoluteURI)

Create an HTTP PUT request to send to the server using an absolute URI, specifying a response handler to receive the response

param $absoluteURI [string] the absolute URI param $responseHandler [callable] the response handler this method is deprecated putAbs($absoluteURI, $responseHandler)

Arguments

$arg0

string

$arg1

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Set a redirect handler for the http client.

redirectHandler( $arg0) : $this

The redirect handler is called when a 3xx response is received and the request is configured to follow redirects with @see \io\vertx\jphp\core\http\HttpClientRequest::setFollowRedirects.

The redirect handler is passed the @see \io\vertx\jphp\core\http\HttpClientResponse, it can return an @see \io\vertx\jphp\core\http\HttpClientRequest or null.

  • when null is returned, the original response is processed by the original request response handler
  • when a new Future is returned, the client will send this new request
The new request will get a copy of the previous request headers unless headers are set. In this case, the client assumes that the redirect handler exclusively managers the headers of the new request.

The handler must return a Future unsent so the client can further configure it and send it.

Arguments

$arg0

callable

Response

$this

a reference to this, so the API can be used fluently

Create an HTTP request to send to the server with the specified options.

request( $arg0,  $arg1,  $arg2 = null,  $arg3 = null,  $arg4 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $method [string] the HTTP method param $options [RequestOptions | array] the request options request($method, $options)

Create an HTTP request to send to the server at the default host and port.

param $method [string] the HTTP method param $requestURI [string] the relative URI request($method, $requestURI)

Create an HTTP request to send to the server at the specified host and default port.

param $method [string] the HTTP method param $host [string] the host param $requestURI [string] the relative URI request($method, $host, $requestURI)

Create an HTTP request to send to the server with the specified options, specifying a response handler to receive

param $method [string] the HTTP method param $options [RequestOptions | array] the request options param $responseHandler [callable] this method is deprecated request($method, $options, $responseHandler)

Create an HTTP request to send to the server at the default host and port, specifying a response handler to receive the response

param $method [string] the HTTP method param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated request($method, $requestURI, $responseHandler)

Create an HTTP request to send to the server at the specified host and port.

param $method [string] the HTTP method param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI request($method, $port, $host, $requestURI)

Create an HTTP request to send to the server at the specified host and default port, specifying a response handler to receive the response

param $method [string] the HTTP method param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated request($method, $host, $requestURI, $responseHandler)

Create an HTTP request to send to the server at the specified host and port, specifying a response handler to receive the response

param $method [string] the HTTP method param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $responseHandler [callable] the response handler this method is deprecated request($method, $port, $host, $requestURI, $responseHandler)

Arguments

$arg0

string

$arg1

string | RequestOptions | array | integer

$arg2

callable | string

$arg3

callable | string

$arg4

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Create an HTTP request to send to the server using an absolute URI

requestAbs( $arg0,  $arg1,  $arg2 = null) : \io\vertx\jphp\core\http\HttpClientRequest

param $method [string] the HTTP method param $absoluteURI [string] the absolute URI requestAbs($method, $absoluteURI)

Create an HTTP request to send to the server using an absolute URI, specifying a response handler to receive the response

param $method [string] the HTTP method param $absoluteURI [string] the absolute URI param $responseHandler [callable] the response handler this method is deprecated requestAbs($method, $absoluteURI, $responseHandler)

Arguments

$arg0

string

$arg1

string

$arg2

callable

Response

\io\vertx\jphp\core\http\HttpClientRequest

an HTTP client request object

Connect a WebSocket with the specified options

websocket( $arg0,  $arg1,  $arg2 = null,  $arg3 = null,  $arg4 = null,  $arg5 = null,  $arg6 = null,  $arg7 = null) : $this

param $options [RequestOptions | array] the request options param $wsConnect [callable] handler that will be called with the websocket when connected websocket($options, $wsConnect)

Connect a WebSocket at the relative request URI using the default host and port

param $requestURI [string] the relative URI param $wsConnect [callable] handler that will be called with the websocket when connected websocket($requestURI, $wsConnect)

Connect a WebSocket with the specified options

param $options [RequestOptions | array] the request options param $wsConnect [callable] handler that will be called with the websocket when connected param $failureHandler [callable] handler that will be called if websocket connection fails websocket($options, $wsConnect, $failureHandler)

Connect a WebSocket to the host and relative request URI and default port

param $host [string] the host param $requestURI [string] the relative URI param $wsConnect [callable] handler that will be called with the websocket when connected websocket($host, $requestURI, $wsConnect)

Connect a WebSocket with the specified options, and with the specified headers

param $options [RequestOptions | array] the request options param $headers [MultiMap] the headers param $wsConnect [callable] handler that will be called with the websocket when connected websocket($options, $headers, $wsConnect)

Connect a WebSocket at the relative request URI using the default host and port

param $requestURI [string] the relative URI param $wsConnect [callable] handler that will be called with the websocket when connected param $failureHandler [callable] handler that will be called if websocket connection fails websocket($requestURI, $wsConnect, $failureHandler)

Connect a WebSocket at the relative request URI using the default host and port and the specified headers

param $requestURI [string] the relative URI param $headers [MultiMap] the headers param $wsConnect [callable] handler that will be called with the websocket when connected websocket($requestURI, $headers, $wsConnect)

Connect a WebSocket to the specified port, host and relative request URI

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $wsConnect [callable] handler that will be called with the websocket when connected websocket($port, $host, $requestURI, $wsConnect)

Connect a WebSocket to the host and relative request URI and default port

param $host [string] the host param $requestURI [string] the relative URI param $wsConnect [callable] handler that will be called with the websocket when connected param $failureHandler [callable] handler that will be called if websocket connection fails websocket($host, $requestURI, $wsConnect, $failureHandler)

Connect a WebSocket with the specified options, and with the specified headers

param $options [RequestOptions | array] the request options param $headers [MultiMap] the headers param $wsConnect [callable] handler that will be called with the websocket when connected param $failureHandler [callable] handler that will be called if websocket connection fails websocket($options, $headers, $wsConnect, $failureHandler)

Connect a WebSocket to the specified host,relative request UR, and default port and with the specified headers

param $host [string] the host param $requestURI [string] the relative URI param $headers [MultiMap] the headers param $wsConnect [callable] handler that will be called with the websocket when connected websocket($host, $requestURI, $headers, $wsConnect)

Connect a WebSocket with the specified optionsI, with the specified headers and using the specified version of WebSockets

param $options [RequestOptions | array] the request options param $headers [MultiMap] the headers param $version [string] the websocket version param $wsConnect [callable] handler that will be called with the websocket when connected websocket($options, $headers, $version, $wsConnect)

Connect a WebSocket at the relative request URI using the default host and port and the specified headers

param $requestURI [string] the relative URI param $headers [MultiMap] the headers param $wsConnect [callable] handler that will be called with the websocket when connected param $failureHandler [callable] handler that will be called if websocket connection fails websocket($requestURI, $headers, $wsConnect, $failureHandler)

Connect a WebSocket at the relative request URI using the default host and port, the specified headers and the specified version of WebSockets

param $requestURI [string] the relative URI param $headers [MultiMap] the headers param $version [string] the websocket version param $wsConnect [callable] handler that will be called with the websocket when connected websocket($requestURI, $headers, $version, $wsConnect)

Connect a WebSocket to the specified port, host and relative request URI

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $wsConnect [callable] handler that will be called with the websocket when connected param $failureHandler [callable] handler that will be called if websocket connection fails websocket($port, $host, $requestURI, $wsConnect, $failureHandler)

Connect a WebSocket to the specified port, host and relative request URI, and with the specified headers

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $headers [MultiMap] the headers param $wsConnect [callable] handler that will be called with the websocket when connected websocket($port, $host, $requestURI, $headers, $wsConnect)

Connect a WebSocket to the specified host,relative request UR, and default port and with the specified headers

param $host [string] the host param $requestURI [string] the relative URI param $headers [MultiMap] the headers param $wsConnect [callable] handler that will be called with the websocket when connected param $failureHandler [callable] handler that will be called if websocket connection fails websocket($host, $requestURI, $headers, $wsConnect, $failureHandler)

Connect a WebSocket with the specified options, with the specified headers and using the specified version of WebSockets

param $options [RequestOptions | array] the request options param $headers [MultiMap] the headers param $version [string] the websocket version param $wsConnect [callable] handler that will be called with the websocket when connected param $failureHandler [callable] handler that will be called if websocket connection fails websocket($options, $headers, $version, $wsConnect, $failureHandler)

Connect a WebSocket to the specified host, relative request URI and default port with the specified headers and using the specified version of WebSockets

param $host [string] the host param $requestURI [string] the relative URI param $headers [MultiMap] the headers param $version [string] the websocket version param $wsConnect [callable] handler that will be called with the websocket when connected websocket($host, $requestURI, $headers, $version, $wsConnect)

Connect a WebSocket with the specified options, with the specified headers, using the specified version of WebSockets, and the specified websocket sub protocols

param $options [RequestOptions | array] the request options param $headers [MultiMap] the headers param $version [string] the websocket version param $subProtocols [string] the subprotocols to use param $wsConnect [callable] handler that will be called with the websocket when connected websocket($options, $headers, $version, $subProtocols, $wsConnect)

Connect a WebSocket at the relative request URI using the default host and port, the specified headers and the specified version of WebSockets

param $requestURI [string] the relative URI param $headers [MultiMap] the headers param $version [string] the websocket version param $wsConnect [callable] handler that will be called with the websocket when connected param $failureHandler [callable] handler that will be called if websocket connection fails websocket($requestURI, $headers, $version, $wsConnect, $failureHandler)

Connect a WebSocket at the relative request URI using the default host and port, the specified headers, the specified version of WebSockets and the specified sub protocols

param $requestURI [string] the relative URI param $headers [MultiMap] the headers param $version [string] the websocket version param $subProtocols [string] the subprotocols param $wsConnect [callable] handler that will be called with the websocket when connected websocket($requestURI, $headers, $version, $subProtocols, $wsConnect)

Connect a WebSocket to the specified port, host and relative request URI, and with the specified headers

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $headers [MultiMap] the headers param $wsConnect [callable] handler that will be called with the websocket when connected param $failureHandler [callable] handler that will be called if websocket connection fails websocket($port, $host, $requestURI, $headers, $wsConnect, $failureHandler)

Connect a WebSocket to the specified port, host and relative request URI, with the specified headers and using the specified version of WebSockets

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $headers [MultiMap] the headers param $version [string] the websocket version param $wsConnect [callable] handler that will be called with the websocket when connected websocket($port, $host, $requestURI, $headers, $version, $wsConnect)

Connect a WebSocket to the specified host, relative request URI and default port with the specified headers and using the specified version of WebSockets

param $host [string] the host param $requestURI [string] the relative URI param $headers [MultiMap] the headers param $version [string] the websocket version param $wsConnect [callable] handler that will be called with the websocket when connected param $failureHandler [callable] handler that will be called if websocket connection fails websocket($host, $requestURI, $headers, $version, $wsConnect, $failureHandler)

Connect a WebSocket with the specified options, with the specified headers, using the specified version of WebSockets, and the specified websocket sub protocols

param $options [RequestOptions | array] the request options param $headers [MultiMap] the headers param $version [string] the websocket version param $subProtocols [string] the subprotocols to use param $wsConnect [callable] handler that will be called with the websocket when connected param $failureHandler [callable] handler that will be called if websocket connection fails websocket($options, $headers, $version, $subProtocols, $wsConnect, $failureHandler)

Connect a WebSocket to the specified host, relative request URI and default port, with the specified headers, using the specified version of WebSockets, and the specified websocket sub protocols

param $host [string] the host param $requestURI [string] the relative URI param $headers [MultiMap] the headers param $version [string] the websocket version param $subProtocols [string] the subprotocols to use param $wsConnect [callable] handler that will be called with the websocket when connected websocket($host, $requestURI, $headers, $version, $subProtocols, $wsConnect)

Connect a WebSocket at the relative request URI using the default host and port, the specified headers, the specified version of WebSockets and the specified sub protocols

param $requestURI [string] the relative URI param $headers [MultiMap] the headers param $version [string] the websocket version param $subProtocols [string] the subprotocols param $wsConnect [callable] handler that will be called with the websocket when connected param $failureHandler [callable] handler that will be called if websocket connection fails websocket($requestURI, $headers, $version, $subProtocols, $wsConnect, $failureHandler)

Connect a WebSocket to the specified port, host and relative request URI, with the specified headers and using the specified version of WebSockets

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $headers [MultiMap] the headers param $version [string] the websocket version param $wsConnect [callable] handler that will be called with the websocket when connected param $failureHandler [callable] handler that will be called if websocket connection fails websocket($port, $host, $requestURI, $headers, $version, $wsConnect, $failureHandler)

Connect a WebSocket to the specified port, host and relative request URI, with the specified headers, using the specified version of WebSockets, and the specified websocket sub protocols

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $headers [MultiMap] the headers param $version [string] the websocket version param $subProtocols [string] the subprotocols to use param $wsConnect [callable] handler that will be called with the websocket when connected websocket($port, $host, $requestURI, $headers, $version, $subProtocols, $wsConnect)

Connect a WebSocket to the specified host, relative request URI and default port, with the specified headers, using the specified version of WebSockets, and the specified websocket sub protocols

param $host [string] the host param $requestURI [string] the relative URI param $headers [MultiMap] the headers param $version [string] the websocket version param $subProtocols [string] the subprotocols to use param $wsConnect [callable] handler that will be called with the websocket when connected param $failureHandler [callable] handler that will be called if websocket connection fails websocket($host, $requestURI, $headers, $version, $subProtocols, $wsConnect, $failureHandler)

Connect a WebSocket to the specified port, host and relative request URI, with the specified headers, using the specified version of WebSockets, and the specified websocket sub protocols

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $headers [MultiMap] the headers param $version [string] the websocket version param $subProtocols [string] the subprotocols to use param $wsConnect [callable] handler that will be called with the websocket when connected param $failureHandler [callable] handler that will be called if websocket connection fails websocket($port, $host, $requestURI, $headers, $version, $subProtocols, $wsConnect, $failureHandler)

Arguments

$arg0

string | RequestOptions | array | integer

$arg1

MultiMap | callable | string

$arg2

MultiMap | callable | string

$arg3

MultiMap | callable | string

$arg4

callable | string

$arg5

callable | string

$arg6

callable

$arg7

callable

Response

$this

a reference to this, so the API can be used fluently

Connect a WebSocket with the specified absolute url, with the specified headers, using the specified version of WebSockets, and the specified websocket sub protocols.

websocketAbs( $arg0,  $arg1,  $arg2,  $arg3,  $arg4,  $arg5) : $this

Arguments

$arg0

string

$arg1

MultiMap

$arg2

string

$arg3

string

$arg4

callable

$arg5

callable

Response

$this

a reference to this, so the API can be used fluently

Create a WebSocket stream with the specified options

websocketStream( $arg0,  $arg1 = null,  $arg2 = null,  $arg3 = null,  $arg4 = null,  $arg5 = null) : \io\vertx\jphp\core\http\ReadStream<WebSocket>

param $options [RequestOptions | array] the request options websocketStream($options)

Create a WebSocket stream at the relative request URI using the default host and port and the specified headers

param $requestURI [string] the relative URI websocketStream($requestURI)

Create a WebSocket stream to the specified host, relative request URI and default port

param $host [string] the host param $requestURI [string] the relative URI websocketStream($host, $requestURI)

Create a WebSocket stream with the specified options, and with the specified headers

param $options [RequestOptions | array] the request options param $headers [MultiMap] the headers websocketStream($options, $headers)

Create a WebSocket stream at the relative request URI using the default host and port and the specified headers

param $requestURI [string] the relative URI param $headers [MultiMap] the headers websocketStream($requestURI, $headers)

Create a WebSocket stream to the specified port, host and relative request URI

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI websocketStream($port, $host, $requestURI)

Create a WebSocket stream to the specified host, relative request URI and default port and with the specified headers

param $host [string] the host param $requestURI [string] the relative URI param $headers [MultiMap] the headers websocketStream($host, $requestURI, $headers)

Create a WebSocket stream with the specified options, with the specified headers and using the specified version of WebSockets

param $options [RequestOptions | array] the request options param $headers [MultiMap] the headers param $version [string] the websocket version websocketStream($options, $headers, $version)

Create a WebSocket stream at the relative request URI using the default host and port, the specified headers and the specified version of WebSockets

param $requestURI [string] the relative URI param $headers [MultiMap] the headers param $version [string] the websocket version websocketStream($requestURI, $headers, $version)

Create a WebSocket stream to the specified port, host and relative request URI, and with the specified headers

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $headers [MultiMap] the headers websocketStream($port, $host, $requestURI, $headers)

Create a WebSocket stream with the specified options and with the specified headers and using the specified version of WebSockets

param $host [string] the host param $requestURI [string] the relative URI param $headers [MultiMap] the headers param $version [string] the websocket version websocketStream($host, $requestURI, $headers, $version)

Create a WebSocket stream to the specified port, host and relative request URI, with the specified headers, using the specified version of WebSockets, and the specified websocket sub protocols

param $options [RequestOptions | array] the request options param $headers [MultiMap] the headers param $version [string] the websocket version param $subProtocols [string] the subprotocols to use websocketStream($options, $headers, $version, $subProtocols)

Create a WebSocket stream at the relative request URI using the default host and port, the specified headers, the specified version of WebSockets and the specified sub protocols

param $requestURI [string] the relative URI param $headers [MultiMap] the headers param $version [string] the websocket version param $subProtocols [string] the subprotocols websocketStream($requestURI, $headers, $version, $subProtocols)

Create a WebSocket stream to the specified port, host and relative request URI, with the specified headers and using the specified version of WebSockets

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $headers [MultiMap] the headers param $version [string] the websocket version websocketStream($port, $host, $requestURI, $headers, $version)

Create a WebSocket stream to the specified host, relative request URI and default port, with the specified headers, using the specified version of WebSockets, and the specified websocket sub protocols

param $host [string] the host param $requestURI [string] the relative URI param $headers [MultiMap] the headers param $version [string] the websocket version param $subProtocols [string] the subprotocols to use websocketStream($host, $requestURI, $headers, $version, $subProtocols)

Create a WebSocket stream to the specified port, host and relative request URI, with the specified headers, using the specified version of WebSockets, and the specified websocket sub protocols

param $port [integer] the port param $host [string] the host param $requestURI [string] the relative URI param $headers [MultiMap] the headers param $version [string] the websocket version param $subProtocols [string] the subprotocols to use websocketStream($port, $host, $requestURI, $headers, $version, $subProtocols)

Arguments

$arg0

string | RequestOptions | array | integer

$arg1

MultiMap | string

$arg2

MultiMap | string

$arg3

MultiMap | string

$arg4

string

$arg5

string

Response

\io\vertx\jphp\core\http\ReadStream

a stream emitting a WebSocket event when the client connection has been upgraded to a websocket

Create a WebSocket stream with the specified absolute url, the specified headers, using the specified version of WebSockets, and the specified websocket sub protocols.

websocketStreamAbs( $arg0,  $arg1,  $arg2,  $arg3) : \io\vertx\jphp\core\http\ReadStream<WebSocket>

Arguments

$arg0

string

$arg1

MultiMap

$arg2

string

$arg3

string

Response

\io\vertx\jphp\core\http\ReadStream

a stream emitting a WebSocket event when the client connection has been upgraded to a websocket