Send a GET request to the given URL.

@param string $path - URL to make request to (relative to base URL)
@param array $query - Key-value array of query string values
@param bool $withAuthorization - Should this request be authorized?
@return array
965370
public function get($path, $query = [], $withAuthorization = true)
    {
        $options = [
            'query' => $query,
        ];

        return $this->send('GET', $path, $options, $withAuthorization);
    }
1188663
def get(self, path, query=None, redirects=True):
        
        return self.request('GET', path, query, None, redirects)
370540
public function get($path, $params = array())
    {
        if (is_array($params) && array_key_exists("query", $params)) {
            $params["query"] = $this->castBooleanValuesToStrings($params["query"]);
        }

        $response = $this->http_client->request('GET', $path, $params);
        $this->handleErrors($response);
        return $response;
    }
413296
private function request(string $method, string $path, array $query = [], $body = null): string
    {
        // Prepare request:
        $query = build_query($query);
        $body = $this->parseBody($body);
        $path = trim($path, '/');
        $request = new Request(
            $method,
            "{$this->baseUri}/v3/$path/?$query",
            ['Content-Type' => 'application/json'],
            $body
        );

        return (string) $this->query($request)->getBody();
    }
685892
public static function Request($WithWebRoot = FALSE, $WithDomain = FALSE, $RemoveSyndication = FALSE) {
      $Result = Gdn::Request()->Path();
      if($WithWebRoot)
         $Result = self::WebRoot($WithDomain).'/'.$Result;
      return $Result;
   }
241130
protected function sendRequest($path, $method = 'GET', $data = array(), $useToken = true)
    {
        $url = $this->apiUrl . '/' . $path;
        $method = strtoupper($method);
        $curl = curl_init();

        if ($useToken && !empty($this->token)) {
            $headers = array('Authorization: Bearer ' . $this->token);
            curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
        }

        switch ($method) {
            case 'POST':
                curl_setopt($curl, CURLOPT_POST, count($data));
                curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));
                break;
            case 'PUT':
                curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT');
                curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));
                break;
            case 'DELETE':
                curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'DELETE');
                curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));
                break;
            default:
                if (!empty($data)) {
                    $url .= '?' . http_build_query($data);
                }
        }

        curl_setopt($curl, CURLOPT_URL, $url);
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_HEADER, true);
        curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 15);
        curl_setopt($curl, CURLOPT_TIMEOUT, 15);

        $response = curl_exec($curl);
        $header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
        $headerCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
        $responseBody = substr($response, $header_size);

        curl_close($curl);

        if ($headerCode === 401 && $this->refreshToken === 0) {
            ++$this->refreshToken;
            $this->getToken();
            $retval = $this->sendRequest($path, $method, $data);
        } else {
            $retval = new stdClass();
            $retval->data = json_decode($responseBody);
            $retval->http_code = $headerCode;
        }

        return $retval;
    }
500963
public function withPath($path): UriInterface
   {
       if (!is_string($path)
        || !($parsedPath = $this->parsePath($path))) {
           throw new InvalidArgumentException(
               "Can't get with path: invalid expression");
       }
       return $this->with("path", $parsedPath);
   }
1200547
public function get($url, array $query = [], array $headers = [])
    {
        return $this->execute('GET', $this->buildGetUrl($url, $query), [], $headers);
    }
198699
function get($path, $query = null, $headers = null, $curlOpts = null) {
        $payload = $this -> encodePostBody($query);
        
        if ($payload !== "") {
            if (strpos($path, '?')) {
                $url = $path . "&" . $payload;
            } else {
                $url = $path . "?" . $payload;
            }
        }else{
            $url = $path;
        }
        
        return $this -> request($url, self::HTTP_GET, '', $headers, $curlOpts);
    }
1138785
protected function setRequestTarget(string $path, string $query)
        {   
            $target = $path;
            if ($target === '') {
                $target = '/';
            }
            
            if ($query != '') {
                $target .= '?'.$query;
            }
            return $target;
        }
575666
private void authorizationRequestSend(final Context context, String path, AuthorizationRequestManager.RequestOptions options, ResponseListener listener) {
        try {
            AuthorizationRequestManager authorizationRequestManager = new AuthorizationRequestManager();
            authorizationRequestManager.initialize(context, listener);
            authorizationRequestManager.sendRequest(path, options);
        } catch (Exception e) {
            throw new RuntimeException("Failed to send authorization request", e);
        }
    }
1194699
public function call($method, $path, array $post = array())
    {
        $useCachedToken = true;
        $token = $this->tokenStorage->get($this->username);
        do {
            if ( ! $token) { // expired or no token
                $token = $this->getNewToken();
                $this->tokenStorage->set($this->username, $token);
                $useCachedToken = false;
            }
            try {
                return $this->http->call($method, $this->host.$path, $post, array(sprintf('Authorization: %s', $token)));
            } catch (TokenExpiredException $tokenExpired) {
                $token = null; // drop the cached token
            }
        } while ($useCachedToken); // retry if a cached token has been used
        throw $tokenExpired; // this means we have a fresh token just expired
    }
321474
public function getBy(array $where = [], array $with = [])
    {
        $query = $this->make($with);

        $query = $this->applyWhere($query, $where);

        return $query->get();
    }
829615
public function post(string $path, array $query = [], array $body = []): ResponseInterface
    {
        return $this->request('POST', $path, $query, $body);
    }
478507
public function post($path, array $parameters, $authorization = false)
    {
    	$query = [];

    	if ($authorization)
    	    $query = [
    	        'client_id' => $this->client_key,
    	    	'client_secret' => $this->client_secret,
    	    	'redirect_uri' => $this->redirect_uri,			 
    	    	'grant_type' => 'authorization_code',
    	    ];

    	if ($parameters)
            $query = array_merge($query, $parameters);

        try {
    	    $response = $this->client->request('POST', $path, [
    	        'form_params' => $query,
		        'timeout' => self::TIMEOUT
    	    ]);

            return $this->toArray($response);
    	} 
    	catch (ClientException $e) {
    	    return $this->toArray($e->getResponse());
        }    	
    }
167860
public function get($path, $params = null){
        $url_params = '';
        if (is_array($params)){
            $url_params = '?' . http_build_query($params);
        }
        
        return $this->_call('GET', $path . $url_params);
    }
1316981
public function request($path, array $body = [], $method = 'GET', array $extraHeaders = [])
    {
        $uri = $this->determineRequestUriFromPath($path);
        /** @var AbstractToken $token */
        $token = $this->storage->retrieveAccessToken($this->service());

        if ($token->isExpired()) {
            throw new ExpiredTokenException(
                sprintf(
                    'Token expired on %s at %s',
                    date('m/d/Y', $token->getEndOfLife()),
                    date('h:i:s A', $token->getEndOfLife())
                )
            );
        }

        // add the token where it may be needed
        if (static::AUTHORIZATION_METHOD_HEADER_OAUTH === $this->getAuthorizationMethod()) {
            $extraHeaders = array_merge(['Authorization' => 'OAuth ' . $token->getAccessToken()], $extraHeaders);
        } elseif (static::AUTHORIZATION_METHOD_QUERY_STRING === $this->getAuthorizationMethod()) {
            $uri->getQuery()->modify(['access_token' => $token->getAccessToken()]);
        } elseif (static::AUTHORIZATION_METHOD_QUERY_STRING_V2 === $this->getAuthorizationMethod()) {
            $uri->getQuery()->modify(['oauth2_access_token' => $token->getAccessToken()]);
        } elseif (static::AUTHORIZATION_METHOD_QUERY_STRING_V3 === $this->getAuthorizationMethod()) {
            $uri->getQuery()->modify(['apikey' => $token->getAccessToken()]);
        } elseif (static::AUTHORIZATION_METHOD_HEADER_BEARER === $this->getAuthorizationMethod()) {
            $extraHeaders = array_merge(['Authorization' => 'Bearer ' . $token->getAccessToken()], $extraHeaders);
        }

        $extraHeaders = array_merge($this->getExtraApiHeaders(), $extraHeaders);

        return $this->httpRequest($uri, $body, $extraHeaders, $method);
    }