protected function call($params = array(), $service = 'search', $method = 'GET',
        $raw = false
    ) {
        $baseUrl = $this->host . '/' . $this->version . '/' . $service;

        // Build Query String
        $query = array();
        foreach ($params as $function => $value) {
            if (is_array($value)) {
                foreach ($value as $additional) {
                    $additional = urlencode($additional);
                    $query[] = "$function=$additional";
                }
            } else {
                $value = urlencode($value);
                $query[] = "$function=$value";
            }
        }
        asort($query);
        $queryString = implode('&', $query);

        // Build Authorization Headers
        $headers = array(
            'Accept' => 'application/'.$this->responseType,
            'x-summon-date' => date('D, d M Y H:i:s T'),
            'Host' => 'api.summon.serialssolutions.com'
        );
        $data = implode($headers, "\n") . "\n/$this->version/$service\n" .
            urldecode($queryString) . "\n";
        $hmacHash = $this->hmacsha1($this->apiKey, $data);
        $headers['Authorization'] = "Summon $this->apiId;$hmacHash";
        if ($this->sessionId) {
            $headers['x-summon-session-id'] = $this->sessionId;
        }

        // Send request
        $result = $this->httpRequest($baseUrl, $method, $queryString, $headers);
        if (!$raw) {
            // Process response
            $result = $this->process($result); 
        }
        return $result;
    }
protected function call($params = array(), $service = 'search', $method = 'GET',
        $raw = false
    ) {
        $baseUrl = $this->host . '/' . $this->version . '/' . $service;

        // Build Query String
        $query = array();
        foreach ($params as $function => $value) {
            if (is_array($value)) {
                foreach ($value as $additional) {
                    $additional = urlencode($additional);
                    $query[] = "$function=$additional";
                }
            } else {
                $value = urlencode($value);
                $query[] = "$function=$value";
            }
        }
        asort($query);
        $queryString = implode('&', $query);

        // Build Authorization Headers
        $headers = array(
            'Accept' => 'application/'.$this->responseType,
            'x-summon-date' => date('D, d M Y H:i:s T'),
            'Host' => 'api.summon.serialssolutions.com'
        );
        $data = implode($headers, "\n") . "\n/$this->version/$service\n" .
            urldecode($queryString) . "\n";
        $hmacHash = $this->hmacsha1($this->apiKey, $data);
        $headers['Authorization'] = "Summon $this->apiId;$hmacHash";
        if ($this->sessionId) {
            $headers['x-summon-session-id'] = $this->sessionId;
        }

        // Send request
        $result = $this->httpRequest($baseUrl, $method, $queryString, $headers);
        if (!$raw) {
            // Process response
            $result = $this->process($result); 
        }
        return $result;
    }
protected function call ( $ params = array ( ) , $ service = 'search' , $ method = 'GET' , $ raw = false ) { $ baseUrl = $ this -> host . '/' . $ this -> version . '/' . $ service ; // Build Query String $ query = array ( ) ; foreach ( $ params as $ function => $ value ) { if ( is_array ( $ value ) ) { foreach ( $ value as $ additional ) { $ additional = urlencode ( $ additional ) ; $ query [ ] = "$function=$additional" ; } } else { $ value = urlencode ( $ value ) ; $ query [ ] = "$function=$value" ; } } asort ( $ query ) ; $ queryString = implode ( '&' , $ query ) ; // Build Authorization Headers $ headers = array ( 'Accept' => 'application/' . $ this -> responseType , 'x-summon-date' => date ( 'D, d M Y H:i:s T' ) , 'Host' => 'api.summon.serialssolutions.com' ) ; $ data = implode ( $ headers , "\n" ) . "\n/$this->version/$service\n" . urldecode ( $ queryString ) . "\n" ; $ hmacHash = $ this -> hmacsha1 ( $ this -> apiKey , $ data ) ; $ headers [ 'Authorization' ] = "Summon $this->apiId;$hmacHash" ; if ( $ this -> sessionId ) { $ headers [ 'x-summon-session-id' ] = $ this -> sessionId ; } // Send request $ result = $ this -> httpRequest ( $ baseUrl , $ method , $ queryString , $ headers ) ; if ( ! $ raw ) { // Process response $ result = $ this -> process ( $ result ) ; } return $ result ; }
Submit REST Request

@param array  $params  An array of parameters for the request
@param string $service The API Service to call
@param string $method  The HTTP Method to use
@param bool   $raw     Return raw (true) or processed (false) response?

@throws SerialsSolutions_Summon_Exception
@return object         The Summon API response (or a PEAR_Error object).
Submit REST Request