Builds a query URL.

@param array $baseOptions  The base options.
@param array $extraOptions The extra options.
@param Tidal $tidal        The TIDAL client.

@return string The encoded options.
557136
public static function buildOptions(array $baseOptions, array $extraOptions, Tidal $tidal)
    {
        $options                = array_merge($baseOptions, $extraOptions);
        $options['countryCode'] = $tidal->getUserInfo()['countryCode'];

        return '?'.http_build_query($options);
    }
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);
	}
    }
654454
public function usePostMethod($uri, array $options)
    {
        if (isset($options['query'])) {
            $url = Url::factory($this->getBaseUrl())->combine($this->expandTemplate($uri, $options['query']));
            return strlen($url) > $this->getConfig('max_query_length');
        }
        return false;
    }
342637
public function generateAttributeValue($originalUrl, $filtersOrConfigurationKey = [], array $extraFilters = [])
    {
        $filters = $this->prepareFilterParams($filtersOrConfigurationKey, $extraFilters);

        return $this->attributeGenerator->generateAttributeValue($originalUrl, $filters);
    }
1216427
public function URLToDOCX($url, GrabzItDOCXOptions $options = null)
	{
		if ($options == null)
		{
			$options = new GrabzItDOCXOptions();
		}		

		$this->request = new GrabzItRequest($this->getRootUrl(false) . GrabzItClient::TakeDOCX, false, $options, $url);
	}
1334809
protected function getUrlOptionsFromConfig(
        $urlConfig,
        array $defaultOptions
    ) {
        $urlOptions = (
            is_array($urlConfig) &&
            isset($urlConfig[2]) &&
            is_array($urlConfig[2])
        )
            ? $urlConfig[2]
            : [];

        return array_merge(
            $defaultOptions,
            $urlOptions
        );
    }
73826
function createUrlFromEndpointAndOptions (endpoint, options) {
  const query = qs.stringify(options);
  const baseURL = `${host}${endpoint}`;
  return query ? `${baseURL}?${query}` : baseURL;
}
336210
public function loadExtraOptions($extraOptions, $instance)
    {
        foreach ($extraOptions as $name => $value) {
            if ($this->reflected->hasMethod($name)) {
                // There is a method to handle this option
                call_user_func_array(
                    array($instance, $name),
                    is_array($value) ? $value : array($value)
                );
                continue;
            }
            if ($this->reflected->hasProperty($name) &&
                $this->reflected->getProperty($name)->isPublic()
            ) {
                // There is a public member we can set for this option
                $instance->$name = $value;
                continue;
            }

            if ($this->canHandle($name)) {
                // There is a custom handler for that option
                $closure = $this->getExtraOptionsHandler($name);
                $closure($instance, $value);
            }
        }
    }
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));
    }
580201
private function getUrl(DataSourceViewInterface $dataSource, array $options = [], array $parameters = [])
    {
        $router = $this->container->get('router');

        return $router->generate(
            $options['route'],
            array_merge(
                isset($this->additional_parameters[$dataSource->getName()])
                    ? $this->additional_parameters[$dataSource->getName()]
                    : [],
                isset($options['additional_parameters'])
                    ? $options['additional_parameters']
                    : [],
                $parameters
            )
        );
    }
598924
protected function appendParametersToUrl($url, array $parameters = array(), array $options = array())
    {
        $url = rtrim($url, '?');
        $queryString = $this->prepareQueryParams($parameters, $options);

        if ($queryString) {
            $uri = new Uri($url);
            $existingQuery = $uri->getQuery();
            $updatedQuery = empty($existingQuery) ? $queryString : $existingQuery . '&' . $queryString;
            $url = (string) $uri->withQuery($updatedQuery);
        }

        return $url;
    }
728392
public function to($path, $extra = [], $secure = null) 
  {
    $url = $baseUrl = home_url($path, $this->getSchemeForUrl($secure));

    if (!empty($extra)) {
      $url = $baseUrl . '?' . http_build_query($extra);
    }

    return $url;
  }
371446
public function custom($customURI, $options = [])
    {
        $url = $this->instanceURLRepo->get();
        $url .= '/services/apexrest';
        $url .= $customURI;

        $parameters = [];

        if (isset($options['parameters'])) {
            $parameters = array_replace_recursive($parameters, $options['parameters']);
            $url .= '?'.http_build_query($parameters);
        }

        return $this->request($url, $options);
    }
755171
public function urlTo($cql, $start = 1, $count = 10, $extraParams = array())
    {
        $qs = array(
            'operation' => 'searchRetrieve',
            'version' => $this->version,
            'recordSchema' => $this->schema,
            'maximumRecords' => $count,
            'query' => $cql
        );

        if ($start != 1) {
            // At least the BIBSYS SRU service, specifying startRecord results in
            // a less clear error message when there's no results
            $qs['startRecord'] = $start;
        }

        foreach ($extraParams as $key => $value) {
            $qs[$key] = $value;
        }

        return $this->url . '?' . http_build_query($qs);
    }
421104
public static function cloudinary_url($source, &$options = array())
    {
        $source = self::check_cloudinary_field($source, $options);
        self::patch_fetch_format($options);
        $type = Cloudinary::option_consume($options, "type", "upload");
        $transformation = Cloudinary::generate_transformation_string($options);

        $resource_type = Cloudinary::option_consume($options, "resource_type", "image");
        $version = Cloudinary::option_consume($options, "version");
        $force_version = Cloudinary::option_consume(
            $options,
            "force_version",
            Cloudinary::config_get("force_version", true)
        );
        $format = Cloudinary::option_consume($options, "format");

        $cloud_name = Cloudinary::option_consume($options, "cloud_name", Cloudinary::config_get("cloud_name"));
        if (!$cloud_name) {
            throw new InvalidArgumentException("Must supply cloud_name in tag or in configuration");
        }
        $secure = Cloudinary::option_consume($options, "secure", Cloudinary::config_get("secure"));
        $private_cdn = Cloudinary::option_consume($options, "private_cdn", Cloudinary::config_get("private_cdn"));
        $secure_distribution = Cloudinary::option_consume(
            $options,
            "secure_distribution",
            Cloudinary::config_get("secure_distribution")
        );
        $cdn_subdomain = Cloudinary::option_consume(
            $options,
            "cdn_subdomain",
            Cloudinary::config_get("cdn_subdomain")
        );
        $secure_cdn_subdomain = Cloudinary::option_consume(
            $options,
            "secure_cdn_subdomain",
            Cloudinary::config_get("secure_cdn_subdomain")
        );
        $cname = Cloudinary::option_consume($options, "cname", Cloudinary::config_get("cname"));
        $shorten = Cloudinary::option_consume($options, "shorten", Cloudinary::config_get("shorten"));
        $sign_url = Cloudinary::option_consume($options, "sign_url", Cloudinary::config_get("sign_url"));
        $api_secret = Cloudinary::option_consume($options, "api_secret", Cloudinary::config_get("api_secret"));
        $url_suffix = Cloudinary::option_consume($options, "url_suffix", Cloudinary::config_get("url_suffix"));
        $use_root_path = Cloudinary::option_consume($options, "use_root_path", Cloudinary::config_get("use_root_path"));
        $auth_token = Cloudinary::option_consume($options, "auth_token");
        if (is_array($auth_token)) {
            $auth_token = array_merge(self::config_get("auth_token", array()), $auth_token);
        } elseif (is_null($auth_token)) {
            $auth_token = self::config_get("auth_token");
        }

        if (!$source) {
            return $source;
        }

        if (preg_match("/^https?:\//i", $source)) {
            if ($type == "upload") {
                return $source;
            }
        }

        $resource_type_and_type = Cloudinary::finalize_resource_type(
            $resource_type,
            $type,
            $url_suffix,
            $use_root_path,
            $shorten
        );
        $sources = Cloudinary::finalize_source($source, $format, $url_suffix);
        $source = $sources["source"];
        $source_to_sign = $sources["source_to_sign"];

        if (empty($version) && $force_version && strpos($source_to_sign, "/") &&
            !preg_match("/^https?:\//", $source_to_sign) && !preg_match("/^v[0-9]+/", $source_to_sign)) {
            $version = "1";
        }
        $version = $version ? "v" . $version : null;

        $signature = null;
        if ($sign_url && !$auth_token) {
            $to_sign = implode("/", array_filter(array($transformation, $source_to_sign)));
            $signature = self::base64url_encode(sha1($to_sign . $api_secret, true));
            $signature = 's--' . substr($signature, 0, 8) . '--';
        }

        $prefix = Cloudinary::unsigned_download_url_prefix(
            $source,
            $cloud_name,
            $private_cdn,
            $cdn_subdomain,
            $secure_cdn_subdomain,
            $cname,
            $secure,
            $secure_distribution
        );

        $source = preg_replace(
            "/([^:])\/+/",
            "$1/",
            implode(
                "/",
                array_filter(
                    array(
                        $prefix,
                        $resource_type_and_type,
                        $signature,
                        $transformation,
                        $version,
                        $source,
                    )
                )
            )
        );

        if ($sign_url && $auth_token) {
            $path = parse_url($source, PHP_URL_PATH);
            $token = \Cloudinary\AuthToken::generate(array_merge($auth_token, array("url" => $path)));
            $source = $source . "?" . $token;
        }

        return $source;
    }
688501
public function generateImage($originalUrl, $attributesFiltersOrConfigurationKey = [], array $extraFilters = [])
    {
        $attributesFilters = $this->prepareFilterParams($attributesFiltersOrConfigurationKey, $extraFilters);

        return $this->imageGenerator->generateImage($originalUrl, $attributesFilters);
    }
114795
function appendQueryStringOptions(requestUrl, queryStringOptions) {
    requestUrl += "?";
    for (var prop in queryStringOptions) {
        if (queryStringOptions.hasOwnProperty(prop)) {
            requestUrl += prop + "=" + queryStringOptions[prop] + "&";
        }
    }

    //Remove the last & from the string
    requestUrl = requestUrl.substr(0, requestUrl.length - 1);
    return requestUrl;
}