@param string $url
@param array  $parameters

@return string
333273
protected function normalizeUrl($url, array $parameters = [])
    {
        $normalizedUrl = $url;
        if (!empty($parameters)) {
            $normalizedUrl .= (false !== strpos($url, '?') ? '&' : '?').http_build_query($parameters, '', '&');
        }

        return $normalizedUrl;
    }
600122
public function delete($url, $parameters = []) {
        $this->setRequestMethod('DELETE');
        $this->setURL($this->buildURL($url, $parameters));

        return $this->run();
    }
280451
public function urlWithQuerystring(string $url, string $allowedParameters = null) : string
    {
        if (!$allowedParameters) {
            return $url;
        }

        $allowedParameters = str_start($allowedParameters, '/');
        $allowedParameters = str_finish($allowedParameters, '/');

        $currentQuery = collect(request()->query())->filter(function ($value, $parameter) use ($allowedParameters) {
            return preg_match($allowedParameters, sprintf('%s=%s', $parameter, $value));
        });

        if (!$newQuery = http_build_query($currentQuery->all())) {
            return $url;
        };

        return sprintf('%s?%s', $url, $newQuery);
    }
661411
protected function get_url( $url, $params ) {
		if ( empty( $params ) ) {
			return $url;
		}
		$q = strpos( $url, '?' ) !== false ? '&' : '?';

		return $url . $q . http_build_query( $params );
	}
1204681
private function makeUri($url, $params = array())
    {
        $uri = \GuzzleHttp\uri_template($this->endpoint, array_merge($this->defaults, $params));
        $uri = new Psr7\Uri($uri);

        // All arguments must be urlencoded (as per RFC 1738).
        $query = Psr7\build_query($params, PHP_QUERY_RFC1738);
        $uri = $uri->withQuery($query);

        return Psr7\Uri::withQueryValue($uri, 'url', $url);
    }
1310564
public function get($url, $parameters = [])
    {
        $httpClient = $this->client->getHttpClient();

        if (!empty($this->pager)) {
            $parameters['page'] = $this->pager->getPage();
            $parameters['perPage'] = $this->pager->getResultsPerPage();
        }

        $response = $httpClient->get($url, ['query' => $parameters]);

        return $httpClient->parseResponse($response);
    }
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;
    }
150294
private function createSignature(string $url, array $parameters): string
    {
        return 'giantbomb-'.\mb_substr(\sha1($this->buildQueryUrl($url, $parameters)), 0, 7);
    }
349475
public function render(array $parameters = []): string
    {
        /** @var Location $location */
        $location = $parameters['location'];
        /** @var Content $content */
        $content = $parameters['content'];
        /** @var Language $language */
        $language = $parameters['language'];
        $versionNo = $content->getVersionInfo()->versionNo;

        // nonpublished content should use parent location instead because location doesn't exist yet
        if (!$content->contentInfo->published && null === $content->contentInfo->mainLocationId) {
            $parentLocations = $this->locationService->loadParentLocationsForDraftContent($content->getVersionInfo());
            $location = reset($parentLocations);
            $versionNo = null;
        }

        $siteaccesses = $this->siteaccessResolver->getSiteaccessesForLocation(
            $location,
            $versionNo,
            $language->languageCode
        );

        if (empty($siteaccesses)) {
            return $this->twig->render(
                '@ezdesign/content/content_edit/component/preview_unavailable.html.twig'
            );
        }

        return '';
    }
635098
private static function parametersToHeaders($parameters)
    {
        $filtered = array_filter(array_keys($parameters), function ($key) {
            return strpos($key, 'HTTP_') === 0;
        });
        $transformKey = function ($key) {
            $parts = explode('_', $key);
            $lowerCase = array_map('strtolower', array_slice($parts, 1));
            $firstUpper = array_map('ucfirst', $lowerCase);
            return implode('-', $firstUpper);
        };

        return array_reduce($filtered, function ($acc, $key) use ($parameters, $transformKey) {
            $headerKey = $transformKey($key);

            return array_merge(
                $acc,
                [$headerKey => $parameters[$key]]
            );
        }, []);
    }
1173181
public function get($url, array $params = [])
    {
       $queryString = '?' . http_build_query($params);

       $url = $url . $queryString;

       $request = new Request(
            $url,
            'GET'
        );

        return $this->send($request);
    }
689033
public function toUri(array $parameters = [])   
    {
        
        $pattern = $this->getPattern();

        $wildcardsRegexes = $this->wildcardsToRegexGroups(
            $matches = $this->getPatternWildcards()
        );

        $parameters = array_slice($parameters, 0, count($wildcardsRegexes));
        
        $this->validateParametersByWildcards($matches, $parameters);

        $uri = preg_replace($wildcardsRegexes, $parameters, $pattern, 1);

        return '/' . rtrim($uri, '/');

    }
554479
public function get($url, $headers = [], $parameters = null)
    {
        return $this->send(Method::GET, $url, $parameters, $headers);
    }
832955
public function url($url, $parameters = [])
    {
        $this->url = $url;
        $this->parameters = $parameters;

        return $this;
    }
497025
public function getUri($parameters = [])
    {
        $uri = $this->uri;
        foreach ($parameters as $name => $value) {
            if (!is_numeric($name)) {
                $uri = str_replace(['#'.$name, '::'.$name, ':'.$name], $value, $uri);
                unset($parameters[$name]);
            }
        }
        ksort($parameters);
        foreach ($parameters as $value) {
            $uri = preg_replace('@^([^:#]*)(:|::|#)\w+@', '${1}'.$value, $uri);
        }
        $uri = preg_replace('@\(([^):#]*)\)@', '${1}', $uri);
        $uri = preg_replace('@\([^)]*\)@', '', $uri);
        $uri = preg_replace('@(:|::|#)(\w+)@', '', $uri);
        return $uri;
    }
768351
public function composeUrl($url, array $params = [])
    {
        if (strpos($url, '?') === false) {
            $url .= '?';
        } else {
            $url .= '&';
        }
        $url .= http_build_query($params, '', '&', PHP_QUERY_RFC3986);
        return $url;
    }
248596
private function buildUrl(array $url, array $params = array())
    {
        ksort($params);
        $url['query'] = http_build_query($params, '', '&');

        $scheme   = isset($url['scheme']) ? $url['scheme'].'://' : '';
        $host     = isset($url['host']) ? $url['host'] : '';
        $port     = isset($url['port']) ? ':'.$url['port'] : '';
        $user     = isset($url['user']) ? $url['user'] : '';
        $pass     = isset($url['pass']) ? ':'.$url['pass']  : '';
        $pass     = ($user || $pass) ? $pass . '@' : '';
        $path     = isset($url['path']) ? $url['path'] : '';
        $query    = isset($url['query']) && $url['query'] ? '?'.$url['query'] : '';
        $fragment = isset($url['fragment']) ? '#'.$url['fragment'] : '';

        return $scheme.$user.$pass.$host.$port.$path.$query.$fragment;
    }