You are here

public function TwitterAPIExchange::request in Heartbeat 8

Helper method to perform our request

Parameters

string $url:

string $method:

string $data:

array $curlOptions:

Return value

string The json response from the server

Throws

\Exception

File

modules/statusmessage/includes/TwitterAPIExchange.php, line 387

Class

TwitterAPIExchange
Twitter-API-PHP : Simple PHP wrapper for the v1.1 API

Code

public function request($url, $method = 'get', $data = null, $curlOptions = array()) {
  if (strtolower($method) === 'get') {
    $this
      ->setGetfield($data);
  }
  else {
    $this
      ->setPostfields($data);
  }
  return $this
    ->buildOauth($url, $method)
    ->performRequest(true, $curlOptions);
}