GeocoderHttpAdapter.php in Geocoder 8.2
File
src/GeocoderHttpAdapter.php
View source
<?php
namespace Drupal\geocoder;
use GuzzleHttp\ClientInterface;
use Ivory\HttpAdapter\AbstractHttpAdapter;
use Ivory\HttpAdapter\Message\InternalRequestInterface;
class GeocoderHttpAdapter extends AbstractHttpAdapter {
protected $httpClient;
public function getName() {
return 'geocoder_http_adapter';
}
public function __construct(ClientInterface $httpClient) {
parent::__construct();
$this->httpClient = $httpClient;
}
protected function sendInternalRequest(InternalRequestInterface $internalRequest) {
return $this->httpClient
->request($internalRequest
->getMethod(), (string) $internalRequest
->getUri(), [
'headers' => $this
->prepareHeaders($internalRequest, FALSE, FALSE),
]);
}
}