You are here

public function HttpClient::__construct in HTTP Client Manager 8.2

Same name and namespace in other branches
  1. 8 src/HttpClient.php \Drupal\http_client_manager\HttpClient::__construct()

Constructs an HttpClient object.

Parameters

string $serviceApi: The service api name for this instance.

\Drupal\http_client_manager\HttpServiceApiHandlerInterface $apiHandler: The service api handler instance.

\Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher: The event dispatcher instance.

File

src/HttpClient.php, line 107

Class

HttpClient
The http client.

Namespace

Drupal\http_client_manager

Code

public function __construct($serviceApi, HttpServiceApiHandlerInterface $apiHandler, EventDispatcherInterface $event_dispatcher) {
  $this->serviceApi = $serviceApi;
  $this->apiHandler = $apiHandler;
  $this->api = $this->apiHandler
    ->load($this->serviceApi);
  $this->eventDispatcher = $event_dispatcher;
}