src/Api/BaseClient.php
protected function callApi(string $method, string $uri, array $options = []): array
    {
        $request = $this->requestBuilder->build($method, $uri, $options);

        $message = $this->requester->sendRequest($request);
        $this->messages[] = $message;

        $this->logMessage($message);

        $exception = $message->getException();
        if (null !== $exception) {
            throw $exception;
        }

        return $this->parseResponse($message->getResponse());
    }
protected function callApi(string $method, string $uri, array $options = []): array
    {
        $request = $this->requestBuilder->build($method, $uri, $options);

        $message = $this->requester->sendRequest($request);
        $this->messages[] = $message;

        $this->logMessage($message);

        $exception = $message->getException();
        if (null !== $exception) {
            throw $exception;
        }

        return $this->parseResponse($message->getResponse());
    }
protected function callApi ( string $ method , string $ uri , array $ options = [ ] ) : array { $ request = $ this -> requestBuilder -> build ( $ method , $ uri , $ options ) ; $ message = $ this -> requester -> sendRequest ( $ request ) ; $ this -> messages [ ] = $ message ; $ this -> logMessage ( $ message ) ; $ exception = $ message -> getException ( ) ; if ( null !== $ exception ) { throw $ exception ; } return $ this -> parseResponse ( $ message -> getResponse ( ) ) ; }
Make a call to the API and returns the parsed JSON.

@param string $method  The HTTP method
@param string $uri     The URI path
@param array  $options An array of optional parameters. The following keys are accepted:
* query   An array of query parameters that will be appended to the URI
* headers An array of headers that will be added to the request
* body    The request body
* host    A string that can be used to override the default client base URI

@throws \Exception

@return array
Make a call to the API and returns the parsed JSON .