class RestTransport implements TransportInterface (View source)

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

never
startClientStreamingCall(Call $call, array $options)

{@inheritdoc}

startServerStreamingCall(Call $call, array $options)

Starts a server streaming call.

never
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

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

No description

Parameters

array $arr

Associative array

array $requiredKeys

List of keys to check for in $arr

Return Value

array

Returns $arr for fluent use

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

No description

Parameters

array $arr

Associative array

array $requiredKeys

List of keys to check for in $arr

Return Value

array

Returns $arr for fluent use

never startClientStreamingCall(Call $call, array $options)

{@inheritdoc}

Parameters

Call $call
array $options

Return Value

never

Exceptions

BadMethodCallException

ServerStream startServerStreamingCall(Call $call, array $options)

Starts a server streaming call.

Parameters

Call $call
array $options

Return Value

ServerStream

never startBidiStreamingCall(Call $call, array $options)

{@inheritdoc}

Parameters

Call $call
array $options

Return Value

never

Exceptions

BadMethodCallException

close()

{@inheritdoc}

__construct(RequestBuilder $requestBuilder, callable $httpHandler)

No description

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.

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. @type callable $clientCertSource A callable which returns the client cert as a string. }

Return Value

RestTransport

Exceptions

ValidationException

PromiseInterface startUnaryCall(Call $call, array $options)

Returns a promise used to execute network requests.

Parameters

Call $call
array $options

Return Value

PromiseInterface

Exceptions

ValidationException