Jyxo\Webdav\Client::sendRequest PHP Method

sendRequest() protected method

Sends a request.
protected sendRequest ( string $path, string $method, array $headers = [] ) : Response
$path string Request path
$method string Request method
$headers array Array of headers
return GuzzleHttp\Psr7\Response
    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);
        }
    }