You are here

public function HttpClientTrait::getHttpClient in Remote Stream Wrapper 8

Returns the HTTP client.

Return value

\GuzzleHttp\ClientInterface

File

src/HttpClientTrait.php, line 36

Class

HttpClientTrait
Trait to help reuse HTTP client logic.

Namespace

Drupal\remote_stream_wrapper

Code

public function getHttpClient() {
  if (!isset($this->httpClient)) {
    $this->httpClient = \Drupal::httpClient();
  }
  return $this->httpClient;
}