You are here

public function gapiRequest::request in Google Analytics Statistics 7.2

Perform http request

Parameters

Array $get_variables:

Array $post_variables:

Array $headers:

2 calls to gapiRequest::request()
gapiRequest::get in includes/gapi.class.php
Perform http GET request
gapiRequest::post in includes/gapi.class.php
Perform http POST request

File

includes/gapi.class.php, line 725

Class

gapiRequest
Google Analytics API request

Code

public function request($get_variables = null, $post_variables = null, $headers = null) {
  $interface = self::http_interface;
  if (self::http_interface == 'auto') {
    $interface = function_exists('curl_exec') ? 'curl' : 'fopen';
  }
  switch ($interface) {
    case 'curl':
      return $this
        ->curlRequest($get_variables, $post_variables, $headers);
    case 'fopen':
      return $this
        ->fopenRequest($get_variables, $post_variables, $headers);
    default:
      throw new Exception('Invalid http interface defined. No such interface "' . self::http_interface . '"');
  }
}