Generate HTTP request URL.

@return (string) URL to create request.
972062
protected function path() {
    $params = [];
    // Take arguments and pass them to the path by replacing {argument} tokens.
    foreach ($this->path_args as $argument => $value) {
      $params["{{$argument}}"] = $value;
    }
    $path = str_replace(array_keys($params), array_values($params), $this->path);
    return $this->endpoint . $path;
  }
613238
public StringBuffer getRequestURL() {

		StringBuffer result = null;
		if(requestURL != null){
			result = new StringBuffer(requestURL);
		}
		
		return result;
	}
591820
public function getHttp()
    {
        if (!$this->http) {
            $this->http = new Http();
            $this->http->setRequest($this);
        }

        return $this->http;
    }
356850
public function getUrl(): string
    {
        $url = $this->url;

        if ($this->getMethod() == self::GET) {
            if (count($this->params) > 0) {
                $params = http_build_query($this->getParams());

                if (strpos('?', $url) !== false && substr($url, -1) != '?') {
                    // just add "&"
                    $url .= $params;
                } else {
                    $url .= '?' . $params;
                }
            }
        }
        return $url;
    }
249026
public static function curPHPUrl() {
        $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on")
              ? 'http'
              : 'https';
        $port = "";
        if ( isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] != "80" && $_SERVER['SERVER_PORT'] != "443" &&
            strpos(':', $_SERVER['HTTP_HOST']) < 0 ) {
            $port =  ':' . $_SERVER['SERVER_PORT'] ;
        }
        $http_url = $scheme .
                              '://' . $_SERVER['HTTP_HOST'] .
                              $port .
                              $_SERVER['REQUEST_URI'];
        return $http_url;
    }
736738
public function requestLine()
    {
        $uri = $this->url->path();
        if ($this->url->query()) {
            $uri .= '?' . $this->url->query();
        }

        return sprintf('%s %s HTTP/%s', $this->method, $uri, $this->version);
    }
1292213
public function createURL() {
		$url = "https://secure.gravatar.com/avatar/".$this->createHash();
		$url = $url."?s=".$this->size."&d=".$this->default."&r=".$this->rating;
		
		if($this->forceDefault == true) {
			$url = $url.'&f=y';
		}
		return $url;
	}
615240
protected function getClientUrl() {
        $protocol = isset($_SERVER['HTTP_X_FORWARDED_PROTO'])
            ? $_SERVER['HTTP_X_FORWARDED_PROTO']
            : isset($_SERVER['REQUEST_SCHEME'])
              ? $_SERVER['REQUEST_SCHEME']
              : (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on')
                ? 'https'
                : 'http';
            
        $host = $_SERVER['HTTP_HOST'];

        $request_uri = $_SERVER['REQUEST_URI'];
        
        return $protocol
            . '://'
            . $host
            . $request_uri;
    }
89406
def generate_url(self, suffix):
        """"""
        url_base_path = os.path.dirname(self.path)
        netloc = "{}:{}".format(*self.server.server_address)
        return urlunparse((
            "http",
            netloc,
            url_base_path + "/" + suffix,
            "", "", ""))
1217473
public static function getUrl()
    {
        if (static::isCLI()) {
            return null;
        }

        if (static::$url === null) {
            $url = 'http';
            if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') {
                $url .= 's';
            }
            $url .= '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
            static::$url = new Url($url);
        }

        return static::$url;
    }
22183
public function getUrl()
    {
        if (!in_array($this->getMethod(), array(RequestInterface::METHOD_GET, RequestInterface::METHOD_HEAD))) {
            return $this->url;
        }

        $url = $this->url;

        if (count($this->data)) {

            $url .= false === strpos($url, '?') ? '?' : '&';
            $url .= http_build_query($this->data);
        }

        return $url;
    }
475216
public function generateUrl($url)
    {
        $extern = false;
        if ((0 === strrpos($url, 'http://'))
            || (0 === strrpos($url, 'https://'))) {
            $extern = true;
        }

        $http = (isset($_SERVER['HTTPS'])) ? 'https://' : 'http://';

        if (!$extern) {
            return ($this->getRoot() == '/')
                ? (($this->getRoot() == $url) ? '' : $url) : $http.$_SERVER['SERVER_NAME'].$this->getRoot().$url;
        } else {
            return $url;
        }
    }
1143047
public function buildUrl()
    {
        $url = $this->getApiUrl();
        if ($endpoint = $this->getEndpoint()) {
            $url .= $endpoint;
        }
        if ($id = $this->getId()) {
            $url .= '/'.$id;
        }
        $parameters = [];
        if ($include = $this->getInclude()) {
            if (is_array($include)) {
                $include = implode(',', $include);
            }
            $parameters['include'] = $include;
        }
        if ($filters = $this->getFilters()) {
            if (!empty($filters)) {
                $parameters['filter'] = $filters;
            }
        }
        if ($pageSize = $this->getPageSize()) {
            if (!empty($pageSize)) {
                $parameters['page'] = ['size' => $pageSize];
            }
        }
        if ($sort = $this->getSort()) {
            if (!empty($sort)) {
                $parameters['sort'] = $sort;
            }
        }
        if ($parameters) {
            $url .= '?'.http_build_query($parameters);
        }
        return $url;
    }
609024
@SuppressWarnings("checkstyle:abbreviationaswordinname")
    public URL constructURL() {
        String params = encodeQueryParams();
        String stringUri = url;

        if (params.length() > 0) {
            stringUri += "?" + params;
        }

        try {
            URI uri = new URI(stringUri);
            return uri.toURL();
        } catch (final URISyntaxException e) {
            throw new ApiException("Bad URI: " + stringUri, e);
        } catch (final MalformedURLException e) {
            throw new ApiException("Bad URL: " + stringUri, e);
        }
    }
810494
public function createRequest()
    {
        return $this->getHttpClient()
            ->createRequest()
            ->addOptions($this->defaultRequestOptions())
            ->addOptions($this->getRequestOptions());
    }
153327
public static function getCurrentUrl() 
    {
        $pageURL = 'http';
        
        if (isset($_SERVER["HTTPS"])) 
        {
            $pageURL .= "s";
        }
        
        $pageURL .= "://";

        if ($_SERVER["SERVER_PORT"] != "80") 
        {
            $pageURL .= $_SERVER["SERVER_NAME"] . ":" . 
                        $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
        } 
        else 
        {
            $pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
        }

        return $pageURL;
    }
452162
public function to_url(): string
	{
		$post_data = $this->to_postdata();
		$out = $this->get_normalized_http_url();
		if ($post_data) {
			$out .= '?' . $post_data;
		}
		return $out;
	}