Example #1
0
 /**
  * Intermediate fetch function
  * @param string $method The HTTP method
  * @param string $url The API endpoint
  * @param string $call The API method to call
  * @param array $params Additional parameters
  * @return mixed
  */
 private function fetch($method, $url, $call, array $params = array())
 {
     // Make the API call via the consumer
     $response = $this->OAuth->fetch($method, $url, $call, $params);
     // Format the response and return
     switch ($this->responseFormat) {
         case 'json':
             return json_encode($response);
         case 'jsonp':
             $response = json_encode($response);
             return $this->callback . '(' . $response . ')';
         default:
             return $response;
     }
 }
Example #2
0
 /**
  * Intermediate fetch function
  * @param string $method The HTTP method
  * @param string $url The API endpoint
  * @param string $call The API method to call
  * @param array $params Additional parameters
  * @return mixed
  */
 private function fetch($method, $url, $call, array $params = array())
 {
     // Make the API call via the consumer
     return $this->OAuth->fetch($method, $url, $call, $params);
 }
 /**
  * Get the OAuth parameter defaults
  *
  * @return array
  */
 private function _getOAuthParams($signatureMethod)
 {
     return array('oauth_consumer_key' => $this->_consumer->getKey(), 'oauth_nonce' => $this->_generateNonce(), 'oauth_signature_method' => $signatureMethod->getName(), 'oauth_timestamp' => $this->_generateTimestmp(), 'oauth_version' => self::OAUTH_VERSION);
 }