src/DefaultYggdrasil.php
private function getResponse($url, $options, $post)
    {
        if($post) {
            $response = $this->httpClient->post($url, $options);
        } else {
            $response = $this->httpClient->get($url, $options);
        }
        if( $response->getStatusCode() != 200 ) {
            $json = $response->json();
            $short = $json['error'];
            $error = $json['errorMessage'];
            $cause = $json['cause'];
            throw new APIRequestException(
                $short == null ? 'Unknown Error' : $short,
                $error == null ? 'Unknown Error' : $error,
                $cause == null ? '' : $cause
            );
        }
        return $response->json();
    }
private function getResponse($url, $options, $post)
    {
        if($post) {
            $response = $this->httpClient->post($url, $options);
        } else {
            $response = $this->httpClient->get($url, $options);
        }
        if( $response->getStatusCode() != 200 ) {
            $json = $response->json();
            $short = $json['error'];
            $error = $json['errorMessage'];
            $cause = $json['cause'];
            throw new APIRequestException(
                $short == null ? 'Unknown Error' : $short,
                $error == null ? 'Unknown Error' : $error,
                $cause == null ? '' : $cause
            );
        }
        return $response->json();
    }
private function getResponse ( $ url , $ options , $ post ) { if ( $ post ) { $ response = $ this -> httpClient -> post ( $ url , $ options ) ; } else { $ response = $ this -> httpClient -> get ( $ url , $ options ) ; } if ( $ response -> getStatusCode ( ) != 200 ) { $ json = $ response -> json ( ) ; $ short = $ json [ 'error' ] ; $ error = $ json [ 'errorMessage' ] ; $ cause = $ json [ 'cause' ] ; throw new APIRequestException ( $ short == null ? 'Unknown Error' : $ short , $ error == null ? 'Unknown Error' : $ error , $ cause == null ? '' : $ cause ) ; } return $ response -> json ( ) ; }
Get a response from the given subURL via POST with the given JSON data. Sets header Content-Type for JSON

@param $url String the full URL to request
@param $options array the options to set on the request
@param $post boolean if true uses POST, otherwise uses GET
@throws APIRequestException if a non 200 code with the error details from the server
@return array json response
Get a response from the given subURL via POST with the given JSON data . Sets header Content - Type for JSON