Makes the request to the Google API

@param array $options for the guzzle request

@return mixed|null
423324
protected function request($options = [])
    {
        try {
            $params = array_filter($this->params);
            $response = $this->getClient()
                ->get($this->getUrl(), ['query' => $params], $options);

            return trim($this->format) === 'json'
                ? json_decode($response->getBody(), true)
                : simplexml_load_string($response->getBody());
        } catch (RequestException $e) {
            return null;
        }
    }
1211489
function request($url,array $options=NULL) {
		$fw=Base::instance();
		$parts=parse_url($url);
		if (empty($parts['scheme'])) {
			// Local URL
			$url=$fw->SCHEME.'://'.$fw->HOST.
				(in_array($fw->PORT,[80,443])?'':(':'.$fw->PORT)).
				($url[0]!='/'?($fw->BASE.'/'):'').$url;
			$parts=parse_url($url);
		}
		elseif (!preg_match('/https?/',$parts['scheme']))
			return FALSE;
		if (!is_array($options))
			$options=[];
		if (empty($options['header']))
			$options['header']=[];
		elseif (is_string($options['header']))
			$options['header']=[$options['header']];
		if (!$this->wrapper)
			$this->engine();
		if ($this->wrapper!='stream') {
			// PHP streams can't cope with redirects when Host header is set
			$this->subst($options['header'],'Host: '.$parts['host']);
		}
		$this->subst($options['header'],
			[
				'Accept-Encoding: gzip,deflate',
				'User-Agent: '.(isset($options['user_agent'])?
					$options['user_agent']:
					'Mozilla/5.0 (compatible; '.php_uname('s').')'),
				'Connection: close'
			]
		);
		if (isset($options['content']) && is_string($options['content'])) {
			if ($options['method']=='POST' &&
				!preg_grep('/^Content-Type:/i',$options['header']))
				$this->subst($options['header'],
					'Content-Type: application/x-www-form-urlencoded');
			$this->subst($options['header'],
				'Content-Length: '.strlen($options['content']));
		}
		if (isset($parts['user'],$parts['pass']))
			$this->subst($options['header'],
				'Authorization: Basic '.
					base64_encode($parts['user'].':'.$parts['pass'])
			);
		$options+=[
			'method'=>'GET',
			'header'=>$options['header'],
			'follow_location'=>TRUE,
			'max_redirects'=>20,
			'ignore_errors'=>FALSE
		];
		$eol="\r\n";
		if ($fw->CACHE &&
			preg_match('/GET|HEAD/',$options['method'])) {
			$cache=Cache::instance();
			if ($cache->exists(
				$hash=$fw->hash($options['method'].' '.$url).'.url',$data)) {
				if (preg_match('/Last-Modified: (.+?)'.preg_quote($eol).'/',
					implode($eol,$data['headers']),$mod))
					$this->subst($options['header'],
						'If-Modified-Since: '.$mod[1]);
			}
		}
		$result=$this->{'_'.$this->wrapper}($url,$options);
		if ($result && isset($cache)) {
			if (preg_match('/HTTP\/1\.\d 304/',
				implode($eol,$result['headers']))) {
				$result=$cache->get($hash);
				$result['cached']=TRUE;
			}
			elseif (preg_match('/Cache-Control:(?:.*)max-age=(\d+)(?:,?.*'.
				preg_quote($eol).')/i',implode($eol,$result['headers']),$exp))
				$cache->set($hash,$result,$exp[1]);
		}
		$req=[$options['method'].' '.$url];
		foreach ($options['header'] as $header)
			array_push($req,$header);
		return array_merge(['request'=>$req],$result);
	}
248374
public static function parse($options)
    {
        if ($options instanceof self) {
            return $options;
        }

        if (is_null($options)) {
            return new RequestOptions(null, array());
        }

        if (is_string($options)) {
            return new RequestOptions($options, array());
        }

        if (is_array($options)) {
            $headers = array();
            $key = null;
            $signOpts = array();
            if (array_key_exists('api_key', $options)) {
                $key = $options['api_key'];
            }
            if (array_key_exists('pingpp_version', $options)) {
                $headers['Pingpp-Version'] = $options['pingpp_version'];
            }
            if (array_key_exists('sign_opts', $options)) {
                $signOpts = $options['sign_opts'];
            }
            return new RequestOptions($key, $headers, $signOpts);
        }

        $message = 'The second argument to Pingpp API method calls is an '
           . 'optional per-request apiKey, which must be a string, or '
           . 'per-request options, which must be an array. (HINT: you can set '
           . 'a global apiKey by "Pingpp::setApiKey(<apiKey>)")';
        throw new Error\Api($message);
    }
929924
public function getClient(array $options = [])
    {
        if ($this->client) {
            return $this->client;
        }

        $this->client = new Client(
            [
                'base_url' => $this->baseUrl,
                'defaults' => [
                    'headers' => [
                        'Authorization' => 'Bearer ' . $this->accessToken,
                    ]
                ]
            ]
        );

        return $this->client;
    }
1038086
public function getEvents(array $options = null)
    {
        $url = ThisData::ENDPOINT_EVENTS;
        if (!is_null($options)) {
            $url .= '?' . http_build_query($options);
        }
        $response = $this->synchronousExecute('GET', $url);
        return json_decode($response->getBody(), TRUE);
    }
1343794
public function getGuzzleResponseAsJson(
        string $uri,
        array $options = [],
        string $method = GuzzleClientInterface::METHOD_GET
    ): ?array {
        $stringResponse = $this->getGuzzleResponseAsString(
            $uri,
            $options,
            $method
        );

        try {
            return JsonUtils::jsonDecode($stringResponse, true);
        } catch (JsonException $e) {
            throw new GuzzleClientException($e);
        }
    }
489484
public function requestAsync($method, $uri = null, array $options = [])
    {
        return $this->doRequest($method, $uri, $options, true);
    }
169477
private function request($url, array $options)
    {
        $response = $this->client->request('POST', $url, $options);

        $body = $response->getBody();
        if ($response->getStatusCode() != 200
                || !isset($body)) {
            throw new \Exception('Failed request to ' . $this->endpoint . '.');
        }

        return $response;
    }
101738
protected function options(array $options = null)
    {
        $dataOptions = $this->options;

        if ($options)
        {
            $dataOptions = $this->merge($dataOptions, $options);
        }

        return $dataOptions;
    }
1080922
public function request($method, $uri = '', array $options = [])
    {
        //Always prepend the api key.

        if (isset($options['query'])) {
            $options['query']['api_key'] = $this->apiKey;
        } else {
            $options['query'] = ['api_key' => $this->apiKey];
        }

        return $this->guzzleClient->request($method, $uri, $options);
    }
1325989
protected function makeRequest($method, $uri, $options)
    {
        $logger = $this->getLogger();

        try {
            $logger->info(sprintf('Making API %s request to %s', $method, $uri), [$options]);

            /** @var ResponseInterface $response */
            $response = $this->_doRequest($method, $uri, $options);

            $logger->debug('Response from HTTP call was status code:', [$response->getStatusCode()]);
            $logger->debug('Response JSON was:', [$response->getBody()]);

            return $response;
        } catch (\Exception $e) {
            throw $e; // Just rethrow for now
        }
    }
65830
protected function send($function, array $options = [])
    {
        $guzzle = $this->getGuzzleClient();

        $url = $this->getUrl();

        // merge options
        $options = $this->getOptions($options);

        // need to reset after every request
        $this->initialize();

        return $guzzle->$function($url, $options);
    }
1273133
public function create(array $options = [])
    {
        $this->info = $this->connection->createTopic($options + [
            'name' => $this->name
        ]);

        return $this->info;
    }
240303
public function get($url, $headers = [], $options = [])
    {
        return $this->request('GET', $url, null, $headers, $options);
    }
1113782
public function queryOrder(array $options)
    {
        $pay = new Order($this->config->get());
        return $pay->query($options);
    }
626080
public function get($url, $params = array(), $options = array())
    {
        return $this->request($url, self::GET, $params, $options);
    }
931681
private function apiRequest($options)
    {
        $params = new \DerivativeRequest(
            $this->getRequest(),
            $options
        );
        $api = new \ApiMain($params);
        $api->execute();

        return $api->getResult()->getResultData();
    }