class RestTransport implements TransportInterface

A REST based transport implementation.

Traits

Provides helper methods for service address handling.
A trait for shared functionality between transports that support only unary RPCs using simple HTTP requests.

Methods

static array
validate(array $arr, array $requiredKeys)

No description

static array
validateNotNull(array $arr, array $requiredKeys)

No description

startClientStreamingCall(Call $call, array $options)

{@inheritdoc}

startServerStreamingCall(Call $call, array $options)

{@inheritdoc}

startBidiStreamingCall(Call $call, array $options)

{@inheritdoc}

close()

{@inheritdoc}

__construct(RequestBuilder $requestBuilder, callable $httpHandler)

No description

static RestTransport
build(string $apiEndpoint, string $restConfigPath, array $config = [])

Builds a RestTransport.

PromiseInterface
startUnaryCall(Call $call, array $options)

Returns a promise used to execute network requests.

Details

in ValidationTrait at line 41
static array validate(array $arr, array $requiredKeys)

Parameters

array $arr Associative array
array $requiredKeys List of keys to check for in $arr

Return Value

array Returns $arr for fluent use

in ValidationTrait at line 51
static array validateNotNull(array $arr, array $requiredKeys)

Parameters

array $arr Associative array
array $requiredKeys List of keys to check for in $arr

Return Value

array Returns $arr for fluent use

startClientStreamingCall(Call $call, array $options)

{@inheritdoc}

Parameters

Call $call
array $options

Exceptions

BadMethodCallException

startServerStreamingCall(Call $call, array $options)

{@inheritdoc}

Parameters

Call $call
array $options

Exceptions

BadMethodCallException

startBidiStreamingCall(Call $call, array $options)

{@inheritdoc}

Parameters

Call $call
array $options

Exceptions

BadMethodCallException

close()

{@inheritdoc}

at line 61
__construct(RequestBuilder $requestBuilder, callable $httpHandler)

Parameters

RequestBuilder $requestBuilder A builder responsible for creating a PSR-7 request from a set of request information.
callable $httpHandler A handler used to deliver PSR-7 requests.

at line 85
static RestTransport build(string $apiEndpoint, string $restConfigPath, array $config = [])

Builds a RestTransport.

Parameters

string $apiEndpoint The address of the API remote host, for example "example.googleapis.com".
string $restConfigPath Path to rest config file.
array $config { Config options used to construct the gRPC transport.

@type callable $httpHandler A handler used to deliver PSR-7 requests. }

Return Value

RestTransport

Exceptions

ValidationException

at line 99
PromiseInterface startUnaryCall(Call $call, array $options)

Returns a promise used to execute network requests.

Parameters

Call $call
array $options

Return Value

PromiseInterface

Exceptions

ValidationException