protected function httpRequest($baseUrl, $method, $queryString, $headers)
    {
        $this->debugPrint(
            "{$method}: {$baseUrl}?{$queryString}"
        );

        // Modify headers as summon needs it in "key: value" format
        $modified_headers = array();
        foreach ($headers as $key=>$value) {
            $modified_headers[] = $key.": ".$value;
        }

        $curl = curl_init();
        $curlOptions = array(
            CURLOPT_RETURNTRANSFER => 1,
            CURLOPT_URL => "{$baseUrl}?{$queryString}",
            CURLOPT_HTTPHEADER => $modified_headers
        );
        curl_setopt_array($curl, $curlOptions);
        $result = curl_exec($curl);
        if ($result === false) {
            throw new SerialsSolutions_Summon_Exception("Error in HTTP Request.");
        }
        curl_close($curl);

        return $result;
    }
protected function httpRequest($baseUrl, $method, $queryString, $headers)
    {
        $this->debugPrint(
            "{$method}: {$baseUrl}?{$queryString}"
        );

        // Modify headers as summon needs it in "key: value" format
        $modified_headers = array();
        foreach ($headers as $key=>$value) {
            $modified_headers[] = $key.": ".$value;
        }

        $curl = curl_init();
        $curlOptions = array(
            CURLOPT_RETURNTRANSFER => 1,
            CURLOPT_URL => "{$baseUrl}?{$queryString}",
            CURLOPT_HTTPHEADER => $modified_headers
        );
        curl_setopt_array($curl, $curlOptions);
        $result = curl_exec($curl);
        if ($result === false) {
            throw new SerialsSolutions_Summon_Exception("Error in HTTP Request.");
        }
        curl_close($curl);

        return $result;
    }
protected function httpRequest ( $ baseUrl , $ method , $ queryString , $ headers ) { $ this -> debugPrint ( "{$method}: {$baseUrl}?{$queryString}" ) ; // Modify headers as summon needs it in "key: value" format $ modified_headers = array ( ) ; foreach ( $ headers as $ key => $ value ) { $ modified_headers [ ] = $ key . ": " . $ value ; } $ curl = curl_init ( ) ; $ curlOptions = array ( CURLOPT_RETURNTRANSFER => 1 , CURLOPT_URL => "{$baseUrl}?{$queryString}" , CURLOPT_HTTPHEADER => $ modified_headers ) ; curl_setopt_array ( $ curl , $ curlOptions ) ; $ result = curl_exec ( $ curl ) ; if ( $ result === false ) { throw new SerialsSolutions_Summon_Exception ( "Error in HTTP Request." ) ; } curl_close ( $ curl ) ; return $ result ; }
Perform a GET HTTP request.

@param string $baseUrl     Base URL for request
@param string $method      HTTP method for request
@param string $queryString Query string to append to URL
@param array  $headers     HTTP headers to send

@throws SerialsSolutions_Summon_Exception
@return string             HTTP response body
Perform a GET HTTP request .