src/Model/ApiResourceBase.php
public static function send(RequestInterface $request, ClientInterface $client, array $options = [])
    {
        $response = null;
        try {
            $response = $client->send($request, $options);
            $body = $response->getBody()->getContents();
            $data = [];
            if ($body) {
                $response->getBody()->seek(0);
                $body = $response->getBody()->getContents();
                $data = \GuzzleHttp\json_decode($body, true);
            }

            return (array) $data;
        } catch (BadResponseException $e) {
            throw ApiResponseException::create($e->getRequest(), $e->getResponse());
        } catch (\InvalidArgumentException $e) {
            throw ApiResponseException::create($request, $response);
        }
    }
public static function send(RequestInterface $request, ClientInterface $client, array $options = [])
    {
        $response = null;
        try {
            $response = $client->send($request, $options);
            $body = $response->getBody()->getContents();
            $data = [];
            if ($body) {
                $response->getBody()->seek(0);
                $body = $response->getBody()->getContents();
                $data = \GuzzleHttp\json_decode($body, true);
            }

            return (array) $data;
        } catch (BadResponseException $e) {
            throw ApiResponseException::create($e->getRequest(), $e->getResponse());
        } catch (\InvalidArgumentException $e) {
            throw ApiResponseException::create($request, $response);
        }
    }
public static function send ( RequestInterface $ request , ClientInterface $ client , array $ options = [ ] ) { $ response = null ; try { $ response = $ client -> send ( $ request , $ options ) ; $ body = $ response -> getBody ( ) -> getContents ( ) ; $ data = [ ] ; if ( $ body ) { $ response -> getBody ( ) -> seek ( 0 ) ; $ body = $ response -> getBody ( ) -> getContents ( ) ; $ data = \ GuzzleHttp \ json_decode ( $ body , true ) ; } return ( array ) $ data ; } catch ( BadResponseException $ e ) { throw ApiResponseException :: create ( $ e -> getRequest ( ) , $ e -> getResponse ( ) ) ; } catch ( \ InvalidArgumentException $ e ) { throw ApiResponseException :: create ( $ request , $ response ) ; } }
Send a Guzzle request.

Using this method allows exceptions to be standardized.

@param RequestInterface $request
@param ClientInterface  $client
@param array            $options

@internal

@return array
Send a Guzzle request .