{@inheritDoc}
@see \Psr\Http\Message\RequestInterface::withUri()
483579
public final function withUri(
       UriInterface $uri,
       $preserveHost = false): RequestInterface
   {
       if (true === $preserveHost
        && !array_key_exists("Host", $this->header)
        && $uri->getHost()) {
           return $this->with("uri", $uri)->withHeader("Host", $uri->getHost());
       }
       return $this->with("uri", $uri);
   }
1007029
public function resolve($uri, $baseUri = null)
    {
        $components = $this->parse($uri);
        $path = $components['path'];

        if ((array_key_exists('scheme', $components)) && ('http' === $components['scheme'])) {
            return $uri;
        }

        $baseComponents = $this->parse($baseUri);
        $basePath = $baseComponents['path'];

        $baseComponents['path'] = UriResolver::combineRelativePathWithBasePath($path, $basePath);

        return $this->generate($baseComponents);
    }
479946
func WithURI(uri string) ClientOptionFunc {
	return func(c *Client) error {
		c.uri = uri
		return nil
	}
}
178936
public function with($with)
    {
        if (is_string($with)) {
            if (strpos($with, ',') === false) {
                $with = [$with];
            } else {
                $with = (array)preg_split('#[\s,]+#', $with, -1, PREG_SPLIT_NO_EMPTY);
            }
        }

        $with = $this->_with ? array_merge($this->_with, $with) : $with;

        foreach ($with as $k => $v) {
            $name = is_string($k) ? $k : $v;
            if (($pos = strpos($name, '.')) === false) {
                continue;
            }
            $parent_name = substr($name, 0, $pos);
            $child_name = substr($name, $pos + 1);
            if (!isset($with[$parent_name])) {
                continue;
            }

            $parent_value = $with[$parent_name];
            if (!$parent_value instanceof QueryInterface) {
                $with[$parent_name] = $this->relationsManager->getQuery($this->_model, $parent_name, $parent_value);
            }

            $with[$parent_name]->with(is_int($k) ? [$child_name] : [$child_name => $v]);
            unset($with[$k]);
        }

        $this->_with = $with;

        return $this;
    }
812864
public function withQuery(string $query): URI
    {
        $result = clone $this;
        $result->query = $this->filterQuery($query);

        return $result;
    }
685892
public static function Request($WithWebRoot = FALSE, $WithDomain = FALSE, $RemoveSyndication = FALSE) {
      $Result = Gdn::Request()->Path();
      if($WithWebRoot)
         $Result = self::WebRoot($WithDomain).'/'.$Result;
      return $Result;
   }
642312
function requestURI( $uri )
    {
        $parsed = parse_url( $uri );

        $return = '';
        if ( isset( $parsed['user'] ) )
        {
            $return .= $parsed['user'] . '@' . $parsed['pass'];
        }
        $params = ( $this->Verb == 'GET' || $this->Verb == 'HEAD' || $this->Verb == 'TRACE' ) ? $this->Parameters : array();
        if ( $this->NameVar == null )
        {
            $return .= rtrim( $parsed['path'], '/' ) . '/' . ltrim( $this->Name, '/' );
        }
        else
        {
            $return .= $parsed['path'];
            if ( $this->Verb == 'GET' || $this->Verb == 'HEAD' )
            {
                $params[$this->NameVar] = $this->Name;
            }
        }

        if ( isset( $parsed['query'] ) )
        {
            $return  .= '?' . $parsed['query'];
            $next = '&';
        }
        else
        {
            $next = '?';
        }
        if ( count( $params ) )
        {
            $return .= $next . $this->_payload( $params );
        }
        if ( isset( $parsed['fragment'] ) )
        {
            $return .= '#' . $parsed['fragment'];
        }

        return $return;
    }
1075846
public function uri(
        $resolverPath,
        $attributes    = array(),
        $withHost      = true
    )
    {
        return $this->routeTranslator->generateUri(
            $resolverPath,
            $attributes,
            $withHost
        );
    }
1289285
public function with(...$with): self
    {
        $this->hasWith = true;
        $this->with = $with;

        return $this;
    }
275033
final public function withUri(UriInterface $uri, $preserveHost = false): self
    {
        $request = clone $this;
        $request->uri = $uri;

        $uriHost = $uri->getHost();
        if ($preserveHost || $uriHost === '') {
            return $request;
        }

        $uriPort = $uri->getPort();
        if ($uriPort !== null) {
            $uriHost .= ":{$uriPort}";
        }
        return $request->withHeader('Host', $uriHost);
    }
921529
public function setTargetUri($targetUri)
    {
        if (null === $targetUri) {
            $targetUri = '';
        }
        $this->_targetUri = (string) $targetUri;
        return $this;
    }
460889
public function getRequestUri() {

		if (NULL === $this->requestUri) {
			$this->requestUri = $this->prepareRequestUri();
		}

		return $this->requestUri;

	}
1334224
public final function withQuery($query): UriInterface
   {
       if (!is_string($query)) {
           throw new InvalidArgumentException(
               "Can't get with query: invalid query string");
       }
       return $this->with("query", $this->parseQuery($query));
   }
26003
public static function ResolveUri( $relative, $baseUri )
	{
		if ( $relative instanceof Undefined )
		{
			return Undefined::getValue();
		}

		$rel = CoreFuncs::NormalizeSpace( $relative . "" );

		if ( ExtFuncs::isAbsoluteUrl( $rel ) )
		{
			return $rel;
		}

		if ( ! ExtFuncs::validateUri( $rel ) )
		{
			throw XPath2Exception::withErrorCodeAndParam( "FORG0002", Resources::FORG0002, $rel );
		}

		if ( $baseUri instanceof Undefined )
		{
			return Undefined::getValue();
		}

		$bsUri = CoreFuncs::NormalizeSpace( $baseUri . "" );

		if ( ! ExtFuncs::isAbsoluteUrl( $bsUri ) || ! ExtFuncs::validateUri( $bsUri ) )
		{
			throw XPath2Exception::withErrorCodeAndParam( "FORG0002", Resources::FORG0002, $rel );
		}

		if ( $bsUri == "" )
		{
			return new AnyUriValue( $rel );
		}

		try
		{
			$url = ExtFuncs::InternetCombineUrl( $bsUri, $rel );
			if ( ! ExtFuncs::validateUri( $url ) )
			// if ( ! filter_var( $url, FILTER_VALIDATE_URL ) )
			{
				throw XPath2Exception::withErrorCode( "FORG0009", Resources::FORG0009 );
			}
			return new AnyUriValue( $url );
		}
		catch ( UriFormatException $ex )
		{
		    throw XPath2Exception::withErrorCode( "FORG0009", Resources::FORG0009 );
		}
	}
98651
protected function parseUri($uri)
    {
        $parts = parse_url($uri);

        if (false === $parts) {
            throw new InvalidArgumentException(
                'The source URI string appears to be malformed'
            );
        }

        $this->scheme = isset($parts['scheme']) ? $this->filterScheme($parts['scheme']) : '';
        $this->userInfo = isset($parts['user']) ? $parts['user'] : '';
        $this->host = isset($parts['host']) ? $parts['host'] : '';
        if (isset($parts['port'])) {
            $this->port = $parts['port'];
        } elseif('https' === $this->scheme) {
            $this->port = 443;
        } else {
            $this->port = 80;
        }
        $this->path = isset($parts['path']) ? $this->filterPath($parts['path']) : '/';
        $this->query = isset($parts['query']) ? $this->filterQuery($parts['query']) : [];
        $this->fragment = isset($parts['fragment']) ? $this->filterFragment($parts['fragment']) : '';

        if (isset($parts['pass'])) {
            $this->userInfo .= ':' . $parts['pass'];
        }

        if (false !== $index = strpos($uri, '.php')) {
            $this->relationPath = substr($uri, ($index + 4));
            if (empty($this->relationPath)) {
                $this->relationPath = '/';
            }
        }
    }
1178746
public RequestHeader withUri(URI uri) {
        return new RequestHeader(method, uri, protocol, acceptedResponseProtocols, principal, headers, lowercaseHeaders);
    }
356720
public function filterRequestUri()
    {
        if ( !empty( $this->versionToken ) )
        {
            // Remove the first occurrence of version token
            $versionSearch = '/' . $this->versionToken;
            $versionPos = strpos( $this->request->uri, $versionSearch );
            if ( $versionPos !== false )
            {
                $this->request->uri = substr_replace( $this->request->uri, '', $versionPos, strlen( $versionSearch ) );
            }
        }
        if ( !empty( $this->apiProviderToken ) )
        {
            // Remove the first occurrence of API provider token
            $providerSearch = '/' . $this->apiProviderToken;
            $providerPos = strpos( $this->request->uri, $providerSearch );
            if ( $providerPos !== false )
            {
                $this->request->uri = substr_replace( $this->request->uri, '', $providerPos, strlen( $providerSearch ) );
            }
        }
    }