src/Twisto/Twisto.php
public function requestJson($method, $url, $data = null)
    {
        $response = $this->request($method, $url, $data);

        $json = json_decode($response, true);
        if ($json === null) {
            throw new Error('API responded with invalid JSON');
        }

        return $json;
    }
public function requestJson($method, $url, $data = null)
    {
        $response = $this->request($method, $url, $data);

        $json = json_decode($response, true);
        if ($json === null) {
            throw new Error('API responded with invalid JSON');
        }

        return $json;
    }
public function requestJson ( $ method , $ url , $ data = null ) { $ response = $ this -> request ( $ method , $ url , $ data ) ; $ json = json_decode ( $ response , true ) ; if ( $ json === null ) { throw new Error ( 'API responded with invalid JSON' ) ; } return $ json ; }
Perform API request and decode response JSON
@param string $method
@param string $url
@param array $data
@return mixed
@throws Error
Perform API request and decode response JSON