Send a GET request to a URL

@param string $url URL to send the GET request to
@param array $headers additional headers to send
@param mixed $parameters parameters to send in the querystring
@return \Ws\Http\Response
2434
public static function get($url, $headers = [], $parameters = null)
    {
        return Request::create('default')->get($url, $headers, $parameters);
    }
337527
protected function request($url, $parameters = array(), $request = false)
        {
            $this->lastRequest = $url;
            $this->lastRequestData = $parameters;
            $this->responseHeaders = array();

            $curl = curl_init($url);

            $curlOptions = array(
                CURLOPT_SSL_VERIFYPEER => false,
                CURLOPT_REFERER        => $url,
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_HEADERFUNCTION => array($this, 'parseHeader'),
            );

            if (! empty($parameters) || ! empty($request)) {
                if (! empty($request)) {
                    $curlOptions[ CURLOPT_CUSTOMREQUEST ] = $request;
                    $parameters = http_build_query($parameters);
                } else {
                    $curlOptions[ CURLOPT_POST ] = true;
                }

                $curlOptions[ CURLOPT_POSTFIELDS ] = $parameters;
            }

            curl_setopt_array($curl, $curlOptions);

            $response = curl_exec($curl);
            $error    = curl_error($curl);

            $this->lastRequestInfo = curl_getinfo($curl);

            curl_close($curl);

            if (! empty($error)) {
                throw new \Exception($error);
            }

            return $this->parseResponse($response);
        }
954407
public static function get(string $url, array $params = null, array $headers = null)
    {
        return static::quickRequest($url, self::GET, $params, $headers);
    }
909265
protected function execute($url, array $headers = array())
    {
        curl_setopt($this->handle, CURLOPT_URL, $url);

        curl_setopt($this->handle, CURLOPT_USERAGENT, $this->useragent);
        curl_setopt($this->handle, CURLOPT_TIMEOUT, $this->timeout);
        curl_setopt($this->handle, CURLOPT_ENCODING, $this->encoding);

        $curlheaders = array();

        $headers = array_merge($this->headers, $headers);
        foreach ($headers as $headerName => $headerValue) {
            $curlheaders[] = "$headerName: $headerValue";
        }

        curl_setopt($this->handle, CURLOPT_HTTPHEADER, $curlheaders);

        $response = curl_exec($this->handle);
        if ($response !== false) {
            $info = curl_getinfo($this->handle);
            if ($info && $info['http_code'] >= 200 && $info['http_code'] < 300) {
                $headers = $this->buffer();

                $info['success'] = true;
                $info['headers'] = $this->parseHeaders($headers);
                $info['data'] = $response;
            } else {
                $info['success'] = false;
            }
        } else {
            $info = array();
            $info['success'] = false;
            $info['error'] = curl_errno($this->handle);
            $info['error_text'] = curl_error($this->handle);
        }

        return (object) $info;
    }
141363
public function post($url, $body, array $headers = [])
    {
        $request = $this->getClient()->createRequest('POST', $url, ['body' => $body]);
        $request->addHeaders($headers);

        return $this->sendRequest($request);
    }
345664
public function delete($url, $headers = [], $body = null)
    {
        return $this->send(Method::DELETE, $url, $body, $headers);
    }
945673
public static final function get($url, array $Params = [], array $Headers = [], $flags = 0b0000) {
		$Curl = curl_init();
		if (preg_match('/^(.*):([0-9]+)$/', $url, $Macth) > 0){
			curl_setopt($Curl, CURLOPT_PORT, $Macth[2]);
			$url = $Macth[1];
		}

		if (count($Params) > 0){
			$url .= '?' . http_build_query($Params, '', '&', PHP_QUERY_RFC3986);
		}

		if (count($Headers) > 0){
			curl_setopt($Curl, CURLOPT_HTTPHEADER, Arr::pack($Headers, ': '));
		}

		curl_setopt($Curl, CURLOPT_URL, $url);
		curl_setopt($Curl, CURLOPT_RETURNTRANSFER, true);
		curl_setopt($Curl, CURLOPT_SSL_VERIFYPEER, true);
		curl_setopt($Curl, CURLOPT_SSL_VERIFYHOST, 2);

		if (self::F_RETURN_HEADERS & $flags) {
			curl_setopt($Curl, CURLOPT_HEADER, true);
		}

		if (($Response = curl_exec($Curl)) === false) {
			$Exception = new \Exception(curl_error($Curl), curl_errno($Curl));
			curl_close($Curl);
			throw $Exception;
		}

		curl_close($Curl);
		return $Response;
	}
624698
public function get($uri, array $parameters = array(), $requestHeaders = array()) {
        try {
            return $this->executeGet($uri, $parameters, $requestHeaders);
        } catch (Unauthenticated $e) {
            $this->auth_token->reset();
            return $this->executeGet($uri, $parameters, $requestHeaders);
        }
    }
456082
public function connect($url, $headers = [], $parameters = null)
    {
        return $this->send(Method::CONNECT, $url, $parameters, $headers);
    }
1280721
protected function send($url, array $params)
    {
        $success = false;

        $rawResponse = $this->client->get($url.'?'.http_build_query($params), [
            'exceptions'      => false,
            'timeout'         => '80',
            'connect_timeout' => '30',
            'headers'         => [
                'Accept'       => 'application/xml',
                'Content-Type' => 'application/x-www-form-urlencoded',
            ],
        ]);

        if ($rawResponse->getStatusCode() == 200) {
            $success = false;
            $response = $this->parse($rawResponse->getBody());

            if (isset($response->error)) {
                $response = $this->responseError($rawResponse);
            } else {
                $success = $response->response->attributes()->type == 'status';
            }
        } else {
            $response = $this->responseError($rawResponse);
        }

        return $this->mapResponse($success, $response);
    }
240303
public function get($url, $headers = [], $options = [])
    {
        return $this->request('GET', $url, null, $headers, $options);
    }
244825
public function put($url, $headers = [], $body = null)
    {
        return $this->send(Method::PUT, $url, $body, $headers);
    }
649145
public function get($url, array $data = [], array $headers = [])
    {
        if ($data) {
            $url .= '?' . http_build_query($data);
        }
        return $this->sendRequest('GET', $url, $headers);
    }
368856
public static function get($url, $headers = array(), $options = array()) {
		return self::request($url, $headers, null, self::GET, $options);
	}
126406
public static function get($url, $httpHeaders = array())
    {
        //Initialize the Curl resource
        $ch = self::init($url, $httpHeaders);

        return self::processRequest($ch);
    }
173991
public function get($url, array $data = [], array $headers = [], $cacheMinutes = 30)
    {
        return $this->send('get', $url, $data, $headers, $cacheMinutes);
    }
132166
protected function get($url, array $headers)
    {
        $request = [
            'headers' => array_merge(
                ['Content-Type' => 'application/json'],
                $headers
            ),
            'exceptions' => false,
        ];

        $this->request('get', $url, $request);
    }