interface TransportInterface

HTTP transport class interface.

Methods

__construct( Registry $options)

Constructor.

request( string $method, Uri $uri, mixed $data = null, array $headers = null, integer $timeout = null, string $userAgent = null)

Send a request to the server and return a HttpResponse object with the response.

static  boolean
isSupported()

Method to check if HTTP transport is available for use

Details

__construct( Registry $options)

Constructor.

Parameters

Registry $options Client options object.

Response request( string $method, Uri $uri, mixed $data = null, array $headers = null, integer $timeout = null, string $userAgent = null)

Send a request to the server and return a HttpResponse object with the response.

Parameters

string $method The HTTP method for sending the request.
Uri $uri The URI to the resource to request.
mixed $data Either an associative array or a string to be sent with the request.
array $headers An array of request headers to send with the request.
integer $timeout Read timeout in seconds.
string $userAgent The optional user agent string to send with the request.

Return Value

Response

static boolean isSupported()

Method to check if HTTP transport is available for use

Return Value

boolean True if available else false