class GeocoderHttpAdapter in Geocoder 8.2
Extends AbstractHttpAdapter to use Guzzle.
Hierarchy
- class \Drupal\geocoder\GeocoderHttpAdapter extends \Ivory\HttpAdapter\AbstractHttpAdapter
Expanded class hierarchy of GeocoderHttpAdapter
1 string reference to 'GeocoderHttpAdapter'
1 service uses GeocoderHttpAdapter
File
- src/
GeocoderHttpAdapter.php, line 12
Namespace
Drupal\geocoderView source
class GeocoderHttpAdapter extends AbstractHttpAdapter {
/**
* The HTTP client.
*
* @var \GuzzleHttp\Client
*/
protected $httpClient;
/**
* {@inheritdoc}
*/
public function getName() {
return 'geocoder_http_adapter';
}
/**
* Creates an HTTP adapter.
*
* @param \GuzzleHttp\ClientInterface $httpClient
* A Guzzle client object.
*/
public function __construct(ClientInterface $httpClient) {
parent::__construct();
$this->httpClient = $httpClient;
}
/**
* {@inheritdoc}
*/
protected function sendInternalRequest(InternalRequestInterface $internalRequest) {
return $this->httpClient
->request($internalRequest
->getMethod(), (string) $internalRequest
->getUri(), [
'headers' => $this
->prepareHeaders($internalRequest, FALSE, FALSE),
]);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
GeocoderHttpAdapter:: |
protected | property | The HTTP client. | |
GeocoderHttpAdapter:: |
public | function | ||
GeocoderHttpAdapter:: |
protected | function | ||
GeocoderHttpAdapter:: |
public | function | Creates an HTTP adapter. |