You are here

public function Remote::getHttpClient in Entity Share 8.3

Prepares a client object with options pulled from the auth plugin.

Parameters

bool $json: Is this client for JSON operations?

Return value

\GuzzleHttp\Client The configured client.

Overrides RemoteInterface::getHttpClient

File

modules/entity_share_client/src/Entity/Remote.php, line 123

Class

Remote
Defines the Remote entity.

Namespace

Drupal\entity_share_client\Entity

Code

public function getHttpClient(bool $json) {
  $plugin = $this
    ->getAuthPlugin();
  if ($json) {
    return $plugin
      ->getJsonApiClient($this->url);
  }
  return $plugin
    ->getClient($this->url);
}