Appends the given set of params to the URL.

@param string $url    The URL the params will be appended to
@param array  $params The params to append to the URL

@return string
516998
protected function appendParamsToUrl(string $url, array $params): string
    {
        if (empty($params['_fields'])) {
            unset($params['_fields']);
        }

        if (empty($params)) {
            return $url;
        }

        // If the _fields param is set transform it to a single string so that
        // it's not urlencoded as an array
        if (isset($params['_fields']) && \is_array($params['_fields'])) {
            $params['_fields'] = array_unique(array_merge($params['_fields'], ['id']));
            $params['_fields'] = implode(',', $params['_fields']);
        }

        // If there is no question mark in the URL we can just add the params
        // to the query string and exit early
        if (strpos($url, '?') === false) {
            return $url . '?' . http_build_query($params, '', '&');
        }

        list($path, $query) = explode('?', $url, 2);

        parse_str($query, $existingParams);

        $params = array_merge($params, $existingParams);

        return $path . '?' . http_build_query($params, '', '&');
    }
782631
public function get($url, $params = null) {
    $this->params = $params;
    $this->method = 'GET';
    $this->url = $url;

    return $this->request();
  }
1209618
public function postUrlEncoded($url, array $params)
    {
        $request = new Request(
            $url,
            'POST',
            'php://temp',
            ['content-type' => 'application/x-www-form-urlencoded']
        );

        $request->getBody()->write(http_build_query($params));
        return $this->send($request);
    }
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;
    }
219535
public function put($url, array $params = [])
    {
        return $this->request($this->createUrl($url), self::METHOD_PUT, $params);
    }
926379
public function put($url, $params = null) {
    $this->params = $params;
    $this->method = 'PUT';
    $this->url = $url;

    return $this->request();
  }
206613
public static function normalize(string $url, array $parameters = []):string
    {
        $normalizedUrl = $url;
        if (!empty($parameters)) {
            $normalizedUrl .= (false !== strpos($url, '?') ? '&' : '?') . http_build_query($parameters, '', '&');
        }
        return $normalizedUrl;
    }
1173181
public function get($url, array $params = [])
    {
       $queryString = '?' . http_build_query($params);

       $url = $url . $queryString;

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

        return $this->send($request);
    }
57891
public function get($url, $params = [])
    {
        if (is_array($url)) {
            return $this->mget($url, $params);
        }
        return $this->exec($this->buildRequest('GET', $url, $params));
    }
1113133
public function supports($url, array $params = array())
    {
        $params = array_merge($this->defaults, $params);
        if (empty($this->scheme)) {
            return false;
        }

        $patterns = array_map(function ($scheme) {
            return str_replace('\*', '.*', preg_quote($scheme, '#'));
        }, $this->scheme);

        $pattern = '#'.implode('|', $patterns).'#i';

        return preg_match($pattern, $url) && !array_diff_key($this->requirements, $params);
    }
536827
public static function createAbsolute($url, array $params = array())
    {
        $url = self::addParams($url, $params);
        $url = ltrim($url, '/');
        $baseUrl = app()->request->getBaseUrl();

        return $baseUrl.'/'.$url;
    }
203076
def _append_params_to_uri(cls, uri, params):
        

        if params:
            return uri + cls._DELIMITER_URL_QUERY + urlencode(params)

        return uri
357306
protected function send($url, array $params)
    {
        $success = false;

        $rawResponse = $this->client->post($url, [
            'exceptions'      => false,
            'timeout'         => '80',
            'connect_timeout' => '30',
            'verify'          => true,
            'auth'            => [
                $this->config['client'],
                $this->config['token'],
            ],
            'headers' => [
                'Accept'         => 'application/json',
                'Accept-Charset' => 'utf-8',
                'Content-Type'   => 'application/x-www-form-urlencoded',
            ],
            'body' => $params,
        ]);

        if (substr((string) $rawResponse->getStatusCode(), 0, 1) === '2') {
            $response = json_decode($rawResponse->getBody(), true);
            $success = true;
        } else {
            $response = $this->responseError($rawResponse);
        }

        return $this->mapResponse($success, $response);
    }
880097
private static function addParams($url, array $params = array())
    {
        $cParams = count($params);

        if ($cParams > 0) {
            $url .= '?';
            $idx = 1;
            foreach ($params as $key => $value) {
                $url .= $key.'='.$value;
                if ($idx < $cParams) {
                    $url .= '&';
                }
                ++$idx;
            }
        }

        return $url;
    }
1167147
public function append($url = '', $argsOrParams = array(), $params = array())
    {
        if (strpos($url, '%s') !== false) {
            $url = vsprintf($url, (array)$argsOrParams);
        } else {
            $params = $argsOrParams;
        }
        if ($params) {
            $url .= (false === strpos($url, '?') ? '?' : '&');
        }
        return $url . (is_array($params) ? http_build_query($params) : $params);
    }
1249548
public function put(string $url, array $params = [])
    {
        return $this->send('PUT', $url, [
            $this->bodyFormat => $params,
        ]);
    }
1238998
static function appendToUrl($url, $append)
	{
		if ( $append )
		{
		    $regs = [];
			if ( preg_match('|^(.+?)(?:\?(.*?))?(#.*)?$|', $url, $regs) )
			{
				$u = $regs[1];  // URL part
				$q = $regs[2];  // querystring
				$a = $regs[3];  // anchor #xxxx
				
				// append a new parameter if one or more already exist
				if ( $q )
					$q = $q . "&" . $append;
				else
					$q = $append;
					
				// rebuild full url
				return $u . '?' . $q . $a;
			}
			else
				// impossible case 
				return $url;
		}
		else
			return $url;
	}