public function request($method, $url, $data = array())
    {
        $url = Api::getFullUrl($url);

        $hooks = new Requests_Hooks();

        $hooks->register('curl.before_send', array($this, 'setCurlSslOpts'));

        $options = array(
            'auth' => array(Api::getKey(), Api::getSecret()),
            'hook' => $hooks,
            'timeout' => 60,
        );

        $headers = $this->getRequestHeaders();

        $response = Requests::request($url, $headers, $data, $method, $options);

        $this->checkErrors($response);

        return json_decode($response->body, true);
    }
public function request($method, $url, $data = array())
    {
        $url = Api::getFullUrl($url);

        $hooks = new Requests_Hooks();

        $hooks->register('curl.before_send', array($this, 'setCurlSslOpts'));

        $options = array(
            'auth' => array(Api::getKey(), Api::getSecret()),
            'hook' => $hooks,
            'timeout' => 60,
        );

        $headers = $this->getRequestHeaders();

        $response = Requests::request($url, $headers, $data, $method, $options);

        $this->checkErrors($response);

        return json_decode($response->body, true);
    }
public function request ( $ method , $ url , $ data = array ( ) ) { $ url = Api :: getFullUrl ( $ url ) ; $ hooks = new Requests_Hooks ( ) ; $ hooks -> register ( 'curl.before_send' , array ( $ this , 'setCurlSslOpts' ) ) ; $ options = array ( 'auth' => array ( Api :: getKey ( ) , Api :: getSecret ( ) ) , 'hook' => $ hooks , 'timeout' => 60 , ) ; $ headers = $ this -> getRequestHeaders ( ) ; $ response = Requests :: request ( $ url , $ headers , $ data , $ method , $ options ) ; $ this -> checkErrors ( $ response ) ; return json_decode ( $ response -> body , true ) ; }
Fires a request to the API
@param  string   $method HTTP Verb
@param  string   $url    Relative URL for the request
@param  array $data Data to be passed along the request
@return array Response data in array format. Not meant
to be used directly
Fires a request to the API