You are here

protected function HttpClient::loadServiceDescription in HTTP Client Manager 8.2

1 call to HttpClient::loadServiceDescription()
HttpClient::createGuzzleClient in src/HttpClient.php
Create a new Guzzle Client by config.

File

src/HttpClient.php, line 243

Class

HttpClient
The http client.

Namespace

Drupal\http_client_manager

Code

protected function loadServiceDescription($config) {
  $base_uri = $config['base_uri'];
  if (empty($this->description[$base_uri])) {
    $source = $this
      ->getApiSourceInfo();
    $loader = $this
      ->getFileLoader();
    $locator = $this
      ->getFileLocator();
    $description = $loader
      ->load($locator
      ->locate($source['basename']));
    $description['baseUrl'] = $base_uri;
    $this->description[$base_uri] = new Description($description);
  }
  return $this->description[$base_uri];
}