Create request url based on base uri and request parameters.

@param  string $baseUri
@param  array $query
@return string
497518
public static function create(string $baseUri, array $query = []): string
    {
        if (count($query) === 0) {
            return $baseUri;
        }

        return sprintf('%s/?%s', $baseUri, http_build_query($query));
    }
120422
private function buildGetUrl($url, array $query = [])
    {
        // Merge global and request queries
        $query = array_merge(
            Arr::get($this->config, 'query', []),
            $query
        );

        // Append query
        if ($query = http_build_query($query)) {
            $url .= strpos($url, '?') ? $query : "?{$query}";
        }

        return $url;
    }
950082
protected function createAbsoluteUrl(UriInterface $basePath, $targetPath)
    {
        $targetPath = strval($targetPath);
        if ($targetPath === '') {
            return $basePath->withPath('');
        } else {
            if ($this->isRelativeUri($targetPath)) {
                $parts = parse_url($targetPath);
                $path  = isset($parts['path']) ? ltrim($parts['path'], '/') : '';
                $query = isset($parts['query']) ? $parts['query'] : '';
                $hash  = isset($parts['fragment']) ? $parts['fragment'] : '';
                $targetPath = $basePath->withPath($path)->withQuery($query)->withFragment($hash);
            }
        }

        return $targetPath;
    }
189393
public URI documentUri(String documentId, Map<String, Object> query)  {
        String base_uri = String.format(
                "%s/%s",
                this.rootUriString,
                this.encodeId(documentId)
        );
        String uri = appendQueryString(base_uri, query);
        return uriFor(uri);
    }
1179266
public function urlAction($action, array $query = [])
    {
        $query['action'] = $action;
        $query = array_replace($this->query(), $query);

        return $this->url() . '?' . http_build_query($query);
    }
704525
def base_query_url(query)
      domain = configuration.api_key ? "pro.ip-api.com" : "ip-api.com"
      url = "#{protocol}://#{domain}/json/#{query.sanitized_text}"
      url << "?" if not url_query_string(query).empty?
      url
    end
1118797
public function post($uri, $query)
    {
        $this->client->post($uri, $query);

        return $this->createResponse();
    }
405102
private function buildQueryUrlParameter($query)
    {
        switch ($query) {
            case is_array($query) && isset($query['lat']) && isset($query['lon']) && is_numeric($query['lat']) && is_numeric($query['lon']):
                return "lat={$query['lat']}&lon={$query['lon']}";
            case is_array($query) && is_numeric($query[0]):
                return 'id='.implode(',', $query);
            case is_numeric($query):
                return "id=$query";
            case is_string($query) && strpos($query, 'zip:') === 0:
                $subQuery = str_replace('zip:', '', $query);
                return 'zip='.urlencode($subQuery);
            case is_string($query):
                return 'q='.urlencode($query);
            default:
                throw new \InvalidArgumentException('Error: $query has the wrong format. See the documentation of OpenWeatherMap::getWeather() to read about valid formats.');
        }
    }
414095
public static function get_uri($with_query=false) {
        $uri_without_get_params = parse_url(self::getHttpRequest()->getUri(), PHP_URL_PATH);

        return (!$with_query)?(
            ($uri_without_get_params != '/')?trim($uri_without_get_params, '/'):'index'
        ):([
            'without_get' => ($uri_without_get_params != '/')?trim($uri_without_get_params, '/'):'index',
            'query' => key($_GET),
        ]);
    }
1249129
public static function for($baseQuery, ?Request $request = null): self
    {
        if (is_string($baseQuery)) {
            $baseQuery = ($baseQuery)::query();
        }

        return new static($baseQuery, $request ?? request());
    }
778424
public function makeUrl( $path = '', array $query = [], bool $context = false, bool $full = null ): string
	{
		if( is_null($full) )
		{
			$url = $this->base;
		}
		else if( $full )
		{
			$url = $this->getPrefix();
		}
		else
		{
			$url = $this->isBasePrefix() ? $this->base_prefix : "/";
		}

		if( is_array($path) )
		{
			$path = implode('/', $path);
		}
		else if( strlen($path) && $path[0] === "/" )
		{
			$path = substr($path, 1);
		}

		if( $context && $this->isContext() )
		{
			if( strlen($path) )
			{
				$path = substr($this->context, 1) . $path;
			}
			else
			{
				$path = trim($this->context, "/");
			}
		}

		return $this->getModeUrl($url, $path, $query);
	}
1145334
public static function create($uri, $base_uri = null): self
    {
        return new self(Uri::create($uri, $base_uri));
    }
256039
public static function uri(string $uri, array $parameters = [], bool $appendsCurrentUri = false)
    {
        $uriComponents = parse_url($uri);

        if (isset($uriComponents['query'])) {
            \parse_str($uriComponents['query'], $uriComponents['query']);
        } else {
            $uriComponents['query'] = [];
        }

        if ($appendsCurrentUri) {
            $newQuery = $parameters + $_GET + $uriComponents['query'];
        } else {
            $newQuery = $parameters + $uriComponents['query'];
        }

        $newUriComponents = isset($uriComponents['scheme']) ? $uriComponents['scheme'] . '://' : '';
        $newUriComponents .= $uriComponents['host'] ?? '';
        $newUriComponents .= isset($uriComponents['port']) ? ':' . $uriComponents['port'] : '';
        $newUriComponents .= $uriComponents['path'] ?? '';
        $newUriComponents .= '?' . http_build_query($newQuery);

        return $newUriComponents;
    }
434621
function buildHTTPGetQuery( $request, $queryParams )
    {
        foreach ( $queryParams as $name => $value )
        {
            if ( is_array( $value ) )
            {
                foreach ( $value as $valueKey => $valuePart )
                {
                    $encodedQueryParams[] = urlencode( $name ) . '=' . urlencode( $valuePart );
                }
            }
            else
            {
                $encodedQueryParams[] = urlencode( $name ) . '=' . urlencode( $value );
            }
        }

        return $this->SearchServerURI . $request . '?' . implode( '&', $encodedQueryParams );
    }
676214
public static String buildUrlQuery(String baseUrl, Map<String, String> params) {
	if (baseUrl.isEmpty() || params.isEmpty()) {
	    return baseUrl;
	} else {
	    String query = baseUrl;
	    query += QUERY_STRING_SEPARATOR;

	    for (String key : params.keySet()) {
		query += key;
		query += PAIR_SEPARATOR;
		query += encodeString(params.get(key));
		query += PARAM_SEPARATOR;
	    }

	    return query.substring(0, query.length() - 1);
	}
    }
1276558
public function get($uri, $query=false)
	{
		$ch = $this->initializeRequest();

		if (is_array($query)) {
			$uri .= "?" . http_build_query($query);
		} elseif ($query) {
			$uri .= "?" . $query;
		}

		curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
		curl_setopt($ch, CURLOPT_URL, $uri);
		curl_setopt($ch, CURLOPT_HTTPGET, true);
		curl_exec($ch);

		$this->checkResponse($ch);

		curl_close($ch);

		return $this;
	}
942328
function urlFor($internalUri, $locale = NULL){
        $internalUri= ltrim($internalUri, '/');
        if($locale == NULL)return $this->request->realBaseUrl . $internalUri;
        else return $this->request->realBaseUrl . $locale . '/' . $internalUri;
    }