class ClientFactory (View source)

Helper class to construct a HTTP client with Drupal specific config.

Properties

protected HandlerStack $stack

The handler stack.

Methods

__construct(HandlerStack $stack)

Constructs a new ClientFactory instance.

Client
fromOptions(array $config = [])

Constructs a new client object from some configuration.

Details

__construct(HandlerStack $stack)

Constructs a new ClientFactory instance.

Parameters

HandlerStack $stack

The handler stack.

Client fromOptions(array $config = [])

Constructs a new client object from some configuration.

Parameters

array $config

The config for the client.

Return Value

Client

The HTTP client.