src/Application/HttpClient/HttpService.php
public function get(
        $uri,
        array $parameters = [],
        array $headers = [],
        string $protocol = '1.1'
    ): ResponseInterface {
        $promise = $this->getAsync($uri, $parameters, $headers, $protocol);
        $promise->wait();

        if ($promise->getState() === Promise::REJECTED) {
            throw $promise->getException();
        }

        return $promise->getResponse();
    }
public function get(
        $uri,
        array $parameters = [],
        array $headers = [],
        string $protocol = '1.1'
    ): ResponseInterface {
        $promise = $this->getAsync($uri, $parameters, $headers, $protocol);
        $promise->wait();

        if ($promise->getState() === Promise::REJECTED) {
            throw $promise->getException();
        }

        return $promise->getResponse();
    }
public function get ( $ uri , array $ parameters = [ ] , array $ headers = [ ] , string $ protocol = '1.1' ) : ResponseInterface { $ promise = $ this -> getAsync ( $ uri , $ parameters , $ headers , $ protocol ) ; $ promise -> wait ( ) ; if ( $ promise -> getState ( ) === Promise :: REJECTED ) { throw $ promise -> getException ( ) ; } return $ promise -> getResponse ( ) ; }
Sends a GET request

@param string|UriInterface $uri        Request URI
@param array               $parameters Query parameters
@param array               $headers    Request headers
@param string              $protocol   Protocol version

@return ResponseInterface

@throws Throwable When an error occurs
Sends a GET request