protected function handleResponse( ResponseInterface $response ){

        $body = json_decode($response->getBody(), true);

        // The expected response should always be JSON, thus now an array.
        if( !is_array($body) ){
            throw new Exception\ApiException( 'Malformed JSON response from server', $response->getStatusCode(), $body, $response );
        }

        return $body;

    }
protected function handleResponse( ResponseInterface $response ){

        $body = json_decode($response->getBody(), true);

        // The expected response should always be JSON, thus now an array.
        if( !is_array($body) ){
            throw new Exception\ApiException( 'Malformed JSON response from server', $response->getStatusCode(), $body, $response );
        }

        return $body;

    }
protected function handleResponse ( ResponseInterface $ response ) { $ body = json_decode ( $ response -> getBody ( ) , true ) ; // The expected response should always be JSON, thus now an array. if ( ! is_array ( $ body ) ) { throw new Exception \ ApiException ( 'Malformed JSON response from server' , $ response -> getStatusCode ( ) , $ body , $ response ) ; } return $ body ; }
Called with a response from the API when the response code was successful. i.e. 20X.

@param ResponseInterface $response

@return array
@throw Exception\ApiException
Called with a response from the API when the response code was successful . i . e . 20X .