public function makeRequest($url, $method='GET', array $parameters=array())
    {
        //Set cURL options
        $this->curl_opts[CURLOPT_URL]        = $url;
        $this->curl_opts[CURLOPT_HTTPHEADER] = $this->headers->getHeaders();

	// Prepare Data
        if (!empty($parameters)) {
            switch($method) {
                case 'POST':
                    $this->curl_opts[CURLOPT_POST] = true;
                    $this->curl_opts[CURLOPT_POSTFIELDS] = Utilities::encodeUrlParam($parameters);
                    break;
                case 'PUT':
                    $file_handle = fopen($parameters, 'r');
                    $this->curl_opts[CURLOPT_PUT] = true;
                    $this->curl_opts[CURLOPT_INFILE] = $file_handle;
                    break;
                case 'DELETE':
                    $this->curl_opts[CURLOPT_CUSTOMREQUEST] = 'delete';
                    break;
            }
        }

        $response = $this->doCurlCall();

		if ($response['response'] === false) {
			throw new RequestException($response['errorMessage'], $response['errorNumber']);
		}

        return $response;
    }
public function makeRequest($url, $method='GET', array $parameters=array())
    {
        //Set cURL options
        $this->curl_opts[CURLOPT_URL]        = $url;
        $this->curl_opts[CURLOPT_HTTPHEADER] = $this->headers->getHeaders();

	// Prepare Data
        if (!empty($parameters)) {
            switch($method) {
                case 'POST':
                    $this->curl_opts[CURLOPT_POST] = true;
                    $this->curl_opts[CURLOPT_POSTFIELDS] = Utilities::encodeUrlParam($parameters);
                    break;
                case 'PUT':
                    $file_handle = fopen($parameters, 'r');
                    $this->curl_opts[CURLOPT_PUT] = true;
                    $this->curl_opts[CURLOPT_INFILE] = $file_handle;
                    break;
                case 'DELETE':
                    $this->curl_opts[CURLOPT_CUSTOMREQUEST] = 'delete';
                    break;
            }
        }

        $response = $this->doCurlCall();

		if ($response['response'] === false) {
			throw new RequestException($response['errorMessage'], $response['errorNumber']);
		}

        return $response;
    }
public function makeRequest ( $ url , $ method = 'GET' , array $ parameters = array ( ) ) { //Set cURL options $ this -> curl_opts [ CURLOPT_URL ] = $ url ; $ this -> curl_opts [ CURLOPT_HTTPHEADER ] = $ this -> headers -> getHeaders ( ) ; // Prepare Data if ( ! empty ( $ parameters ) ) { switch ( $ method ) { case 'POST' : $ this -> curl_opts [ CURLOPT_POST ] = true ; $ this -> curl_opts [ CURLOPT_POSTFIELDS ] = Utilities :: encodeUrlParam ( $ parameters ) ; break ; case 'PUT' : $ file_handle = fopen ( $ parameters , 'r' ) ; $ this -> curl_opts [ CURLOPT_PUT ] = true ; $ this -> curl_opts [ CURLOPT_INFILE ] = $ file_handle ; break ; case 'DELETE' : $ this -> curl_opts [ CURLOPT_CUSTOMREQUEST ] = 'delete' ; break ; } } $ response = $ this -> doCurlCall ( ) ; if ( $ response [ 'response' ] === false ) { throw new RequestException ( $ response [ 'errorMessage' ] , $ response [ 'errorNumber' ] ) ; } return $ response ; }
Send a request to the server, receive a response

@param  string $url Request url
@param string $method HTTP method to use
@param array $parameters Parameters

@return array HTTP response
Send a request to the server receive a response