@param string $uri

@return PromiseInterface
@throws \unreal4u\TelegramAPI\Exceptions\ClientException
548079
public function get(string $uri): PromiseInterface
    {
        $request = new Request($uri);

        return $this->processRequest($request);
    }
266284
public function get($uri, array $options = null)
    {
        return $this->request(self::REQUEST_METHOD_GET, $uri, null, $options);
    }
1197975
public function requestAsync($method, $uri = '', array $options = []): PromiseInterface
    {
        // Ensure the “X-Request-Id” header gets regenerated for every call.
        $options['headers']['X-Request-Id'] = $this->generateV4GUID();

        return parent::requestAsync($method, $uri, $options);
    }
1136458
public function load(UriInterface $uri)
    {
        if (!$uri instanceof DataUriInterface) {
            throw new InvalidUriTypeException(
                $uri,
                'Eloquent\Schemer\Uri\DataUriInterface'
            );
        }

        return new Content(
            $uri->getData(),
            $this->stripMimeTypeParameters($uri->getMimeType())
        );
    }
722309
protected function makeRequest($requestType, $uri, $parameters = [])
    {
        try {
            $this->closeBrowser();
            $this->session = $this->newSession()->open($uri);
            $this->updateCurrentUrl();
        } catch (CurlExec $e) {
            throw new CurlExec(
                "Hold on there, partner. Did you maybe forget to boot up Selenium? " .
                "\n\njava -jar selenium-server-standalone-*.jar" .
                "\n\n" . $e->getMessage()
            );
        }

        return $this;
    }
812976
public function execute(string $uri = null): ApplicationInterface
    {
        $this->callExecute($uri) || parent::execute($uri);

        return $this;
    }
610442
public function callStaticRoute($uri)
    {
        $params = array_slice($this->getUrlSegments(), 2);

        return $this->callController([$uri, $params]);
    }
1262370
public static function get($uri, $options=[])
    {
      if ($token = self::$_config->get('ACCESS_TOKEN')) {
        $uri = $uri . "?access_token=" . $token;
      }
      return self::$_restClient->get($uri, $options);
    }
243290
protected function prepareUrlForRequest($uri)
    {
        if (Str::startsWith($uri, '/')) {
            $uri = substr($uri, 1);
        }

        if (! Str::startsWith($uri, 'http')) {
            $uri = ($this->baseUrl ?? config('app.url')) . '/' . $uri;
        }

        return trim($uri, '/');
    }
161335
function makeUri($uri) {
      $a = parse_url($uri);

      if ( (isset($a['scheme'])) && (isset($a['host'])) ) {
        $this->url = $a;
      } else {
        unset($this->url['query']);
        unset($this->url['fragment']);
        $this->url = array_merge($this->url, $a);
      }

      if ($this->useProxy) {
        $requesturi = 'http://' . $this->url['host'] . (empty($this->url['port']) ? '' : ':' . $this->url['port']) . $this->url['path'] . (empty($this->url['query']) ? '' : '?' . $this->url['query']);
      } else {
        $requesturi = $this->url['path'] . (empty($this->url['query']) ? '' : '?' . $this->url['query']);
      }

      return $requesturi;
    }
901887
public static function create($uri)
    {
        if (($parse = parse_url($uri)) === false) {
            throw new \InvalidArgumentException('Unable to parse URI');
        }

        return new Uri(
            isset($parse[ 'scheme' ])
                ? $parse[ 'scheme' ]
                : '',
            isset($parse[ 'host' ])
                ? $parse[ 'host' ]
                : '',
            isset($parse[ 'path' ])
                ? $parse[ 'path' ]
                : '',
            isset($parse[ 'port' ])
                ? $parse[ 'port' ]
                : '',
            isset($parse[ 'query' ])
                ? $parse[ 'query' ]
                : '',
            isset($parse[ 'fragment' ])
                ? $parse[ 'fragment' ]
                : '',
            isset($parse[ 'user' ])
                ? $parse[ 'user' ]
                : '',
            isset($parse[ 'pass' ])
                ? $parse[ 'pass' ]
                : ''
        );
    }
251143
private function createPromiseForPush(PushInterface $push, RecipientInterface $recipient): PromiseInterface {
        return $this->client->sendAsync($this->prepareRequest($push->getMessage(), $recipient))
            ->otherwise(function (\Exception $exception) use ($push, $recipient) {
                $push->setFailedFor($recipient, $exception);
            });
    }
267404
public static function resolve( $uri ) 
	{	
		// cut unnecessary slashes and params
		if ( substr( $uri, -1 ) == '/' ) 
		{
			$uri = substr( $uri, 0, -1 );
		}
		
		if ( substr( $uri, 0, 1 ) == '/' ) 
		{
			$uri = substr( $uri, 1 );
		}
		
		$uri = CCStr::cut( $uri, '?' );
		
		// create new route instance
		$route = new CCRoute( $uri );
		
		// private route
		if ( substr( $uri, 0, 1 ) == '#' ) {
			if ( !array_key_exists( $uri, static::$privates ) ) 
			{
				throw new CCException( "CCRouter::resolve() - private route {$uri} could not be found." );
			}
			
			return static::configure( $route, static::$privates[$uri] );
		}
		
		// pass the route trough the priority events
		if ( $hook_route = CCEvent::pass( 'ccf.router.resolve.before', array( $route, false ) ) ) 
		{
			if ( $hook_route[1] === true ) 
			{
				return static::configure( $route, $hook_route[0] );
			}
		}
		
		// if the uri is empty root is requestet
		if ( empty( $uri ) ) 
		{
			// try one slash also aka empty
			if ( array_key_exists( '', static::$routes ) ) 
			{
				return static::configure( $route, static::$routes[''] );	
			}
			return static::configure( $route, static::$privates['#root'] );
		}
		
		// simple static key route
		if ( isset( static::$routes[$uri] ) ) 
		{
			return static::configure( $route, static::$routes[$uri] );
		}
		
		// explode the uri
		$uri_parts = explode( '/', $uri );
		
		// get the action
		$action = array_pop( $uri_parts );
			
		// implode the uri without action
		$uri_without_action = implode( '/', $uri_parts );
		
		// try the static key with an action
		if ( isset( $action ) ) 
		{
			if ( isset( static::$routes[$uri_without_action] ) ) 
			{
				if ( CCController::has_action( static::$routes[$uri_without_action], $action ) )
				{
					$route->action = $action;	
					return static::configure( $route, static::$routes[$uri_without_action] );
				}
			}
		}
		
		// dynamic keys
		foreach( static::$routes as $pattern => $dynamic_route ) 
		{	
			// try the dynamic route only if it can be a pattern
			if ( strpos( $pattern, '[' ) !== false && strpos( $pattern, ']' ) !== false ) 
			{
				// build an reqular expression	
				$regx = '#^'.CCStr::replace( $pattern, static::$filters ).'$#i';

				// try to match the uri with regex
				if ( preg_match( $regx, $uri, $params ) ) 
				{	
					// remove the first param
					unset( $params[0] );
					
					$route->action = null;
					$route->params = $params;
					
					return static::configure( $route, $dynamic_route );
				}
				
				// try to match the uri without the action with the regex
				if ( is_string($dynamic_route) && preg_match( $regx, $uri_without_action, $params ) ) 
				{
					if ( CCController::has_action( $dynamic_route, $action ) ) 
					{
						// remove the first param
						unset( $params[0] );
					
						$route->action = $action;
						$route->params = $params;
					
						return static::configure( $route, $dynamic_route );	
					}
				}
			}
		}      
		
		/*
		 * pass to events
		 */
		if ( $hook_route = CCEvent::pass( 'ccf.router.resolve.after', array( $route, false ) ) ) {
			if ( $hook_route[1] === true ) {
				return static::configure( $route, $hook_route[0] );
			}
		}
		
		return false;
	}
1128407
public static function loadFromProvisioningUri(string $uri): OTPInterface
    {
        $parsed_url = parse_url($uri);
        Assertion::isArray($parsed_url, 'Not a valid OTP provisioning URI');
        self::checkData($parsed_url);

        $otp = self::createOTP($parsed_url);

        self::populateOTP($otp, $parsed_url);

        return $otp;
    }
969296
public function resolveAssetUri(string $uri): ?string
    {
        $targetObject = $this->convertUriToObject($uri);
        if ($targetObject === null) {
            $this->systemLogger->info(sprintf('Could not resolve "%s" to an existing asset; The asset was probably deleted.', $uri), LogEnvironment::fromMethodName(__METHOD__));
            return null;
        }
        return $this->resourceManager->getPublicPersistentResourceUri($targetObject->getResource());
    }
1147543
public function withNodeUri($uri)
    {
        $builder = new RiakNodeBuilder();
        $node    = $builder
            ->withProtocol(parse_url($uri, PHP_URL_SCHEME))
            ->withHost(parse_url($uri, PHP_URL_HOST))
            ->withPort(parse_url($uri, PHP_URL_PORT))
            ->withUser(parse_url($uri, PHP_URL_USER))
            ->withPass(parse_url($uri, PHP_URL_PASS))
            ->build();

        return $this->withNode($node);
    }
778947
protected function createPromiseForRequest(RequestInterface $request, bool $processApiException): PromiseInterface
    {
        $clientRequest = $this->createClientRequest($request);
        $promise = $this->guzzleClient->sendAsync($clientRequest);
        $promise = $promise->then(
            function (PsrResponseInterface $clientResponse) use ($request, $clientRequest): ResponseInterface {
                return $this->processResponse($request, $clientRequest, $clientResponse);
            },
            function (RequestException $exception): void {
                $this->processException($exception);
            }
        );

        if ($processApiException) {
            $promise = $promise->then(
                null,
                function (ApiClientException $exception) use ($request): ResponseInterface {
                    return $this->processApiClientException($exception, $request);
                }
            );
        }

        return $promise;
    }