GET request
Use HTTP GET to read data
@param string|Gnkw\Http\Uri $service Service to call
@param string|array $headers Request headers
@param string Possible $data Data to get
@return Gnkw\Http\Rest\Resource
763214
public function get($service, $headers = null, $data = null)
	{
		return $this->customRequest($service, 'GET', $headers, $data);
	}
1013690
public function get($uri, array $headers = [], $body = null)
    {
        return $this->send(new \GuzzleHttp\Psr7\Request('GET', $uri, $headers, $body));
    }
904372
public function get($url, $data = null, $header = [])
    {
        $url = URLUtil::addParameter($url, $data);
        return $this->exec($url, $data, 'get', $header);
    }
279718
public function update($service, $headers = null, $data)
	{
		return $this->put($service, $headers, $data);
	}
969655
public function post($url, $data, $headers = [])
    {
        $request = new Request('POST', $url, $headers);
        $response = $this->apiClient->send(
            $request,
            [
                'form_params' => $data,
            ]
        );
        $result = json_decode($response->getBody(), true);
        return $result;
    }
29670
public function post($url, array $data, array $headers = null)
    {
        $headers = is_null($headers) ? ['Content-Type: application/json; charset=utf-8'] : $headers;
        return $this->sendRequest('POST', $url, $headers, $data);
    }
502965
protected function request($url, $data, array $headers = array())
    {
        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));

        curl_exec($ch);
        $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        curl_close($ch);

        return floor($statusCode / 100) == 2;
    }
729807
public function collectNow(array $data = [], array $headers = [])
    {
        $url = $this->url('hosted_pages/collect_now');

        return $this->post($url, $data, $headers);
    }
1343723
def api_get(self, action, data, headers=None):
        
        return self._api_request(action, data, 'GET', headers)
290236
public function get(string $url, array $headers = [])
    {
        $ctx = $this->getContext('GET', null, $headers);
        $response = file_get_contents($url, false, $ctx);
        $this->saveCookies($http_response_header);

        return $response;
    }
707408
public function get($url, array $headers = array())
    {
        curl_setopt($this->handle, CURLOPT_HTTPGET, true);

        return $this->execute($url, $headers);
    }
132166
protected function get($url, array $headers)
    {
        $request = [
            'headers' => array_merge(
                ['Content-Type' => 'application/json'],
                $headers
            ),
            'exceptions' => false,
        ];

        $this->request('get', $url, $request);
    }
1209351
public static function prepareUri(array $server, array $headers)
    {
        $uri = new PsrUri('');

        // URI scheme
        $scheme = 'http';
        $https = ServerHelper::getValue($server, 'HTTPS');

        // Is https or not
        if (($https && $https !== 'off') || HeaderHelper::getValue($headers, 'x-forwarded-proto', false) === 'https') {
            $scheme = 'https';
        }

        // URI host
        $host = '';
        $port = null;

        static::getHostAndPortFromHeaders($host, $port, $server, $headers);

        // URI path
        $path = static::getRequestUri($server);
        $path = static::stripQueryString($path);

        // URI query
        $query = '';

        if (isset($server['QUERY_STRING'])) {
            $query = ltrim($server['QUERY_STRING'], '?');
        }

        // URI fragment
        $fragment = '';

        if (strpos($path, '#') !== false) {
            list($path, $fragment) = explode('#', $path, 2);
        }

        return $uri->withScheme($scheme)
            ->withHost($host)
            ->withPort($port)
            ->withPath($path)
            ->withFragment($fragment)
            ->withQuery($query);
    }
353348
public function create($service, $headers = null, $data = null)
	{
		return $this->post($service, $headers, $data);
	}
1184363
protected function fetchProviderData($url, array $headers = [])
    {
        $client = $this->getProvider()->getHttpClient();
        $client->setBaseUrl($url);

        if ($headers)
        {
            $client->setDefaultOption('headers', $headers);
        }

        $request = $client->get()->send();
        $response = $request->getBody();

        return $response;
    }
993676
public function get($url, array $params = [], array $headers = [])
    {
        $url = $this->formatUrl($url, $url !== 'current/Me', $url == $this->nextUrl);

        try {
            $request = $this->createRequest('GET', $url, null, $params, $headers);
            $response = $this->client()->send($request);

            return $this->parseResponse($response, $url != $this->nextUrl);
        } catch (Exception $e) {
            $this->parseExceptionForErrorMessages($e);
        }
    }
780396
public function response(array $data, array $headers = [])
    {
        $response = $this->response;
        $response->setJsonContent($data, JSON_UNESCAPED_UNICODE);
        $response->setStatusCode($this->getStatusCode());
        foreach ($headers as $name => $value) {
            $response->setHeader($name, $value);
        }

        return $response;
    }