protected function sendRequest(string $path, string $method, array $headers = []) : \GuzzleHttp\Psr7\Response
{
try {
// Send request to a random server
$request = $this->createRequest($this->getRandomServer(), $path, $method, $headers);
$response = $this->createClient()->send($request, $this->requestOptions);
if (null !== $this->logger) {
$this->logger->log(sprintf("%s %d %s", $request->getMethod(), $response->getStatusCode(), $request->getUri()));
}
return $response;
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
throw new Exception($e->getMessage(), 0, $e);
}
}