<pre>
The referer URL of the request, as defined in
[HTTP/1.1 Header Field Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
</pre>

<code>string referer = 8;</code>
345486
public java.lang.String getReferer() {
    java.lang.Object ref = referer_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      referer_ = s;
      return s;
    }
  }
303765
public function referrerIsSearchEngine()
    {
        $referrerHostExploded = explode('.', $this->getReferrerDomain());
        $numberOfPieces = count($referrerHostExploded);
        $positionToCheck = $numberOfPieces - 2;

        if (!isset($referrerHostExploded[$positionToCheck])) {
            return false;
        }

        if (strlen($referrerHostExploded[$positionToCheck]) <= 3) {
            --$positionToCheck;

            if (!isset($referrerHostExploded[$positionToCheck])) {
                return false;
            }
        }

        return in_array(
            $referrerHostExploded[$positionToCheck],
            [
                'baidu',
                'bing',
                'bleikko',
                'duckduckgo',
                'exalead',
                'gigablast',
                'google',
                'munax',
                'qwant',
                'sogou',
                'yahoo',
                'yandex',
            ]
        );
    }
383290
def _initURL(self,
                 org_url,
                 referer_url):
        


        if org_url is not None and org_url != '':
            if not org_url.startswith('http://') and not org_url.startswith('https://'):
                org_url = 'https://' + org_url
            self._org_url = org_url

        if self._org_url.lower().find('/sharing/rest') > -1:
            self._url = self._org_url
        else:
            self._url = self._org_url + "/sharing/rest"

        if self._url.startswith('http://'):
            self._surl = self._url.replace('http://', 'https://')
        else:
            self._surl = self._url

        parsed_url = urlparse(self._org_url)
        self._parsed_org_url = urlunparse((parsed_url[0],parsed_url[1],"","","",""))#added 7/15/2015

        if referer_url is None:
            self._referer_url = parsed_url.netloc
1297797
private String scopesToString(Auth.UrlCodex urlCodex) {
        if (scopes == null || scopes.length == 0) {
            return "";
        }
        StringBuilder sb = new StringBuilder();
        boolean needsSeparator = false;
        for (String scope : scopes) {
            if (needsSeparator) {
                sb.append(scopeDelimiter);
            }
            needsSeparator = true;

            // Use the URL codex to encode each scope, if provided.
            sb.append(urlCodex == null ? scope : urlCodex.encode(scope));
        }
        return sb.toString();
    }
819823
@Sensitive
    private String getStoredReq(HttpServletRequest req, ReferrerURLCookieHandler referrerURLHandler) {
        String storedReq = referrerURLHandler.getReferrerURLFromCookies(req, ReferrerURLCookieHandler.REFERRER_URL_COOKIENAME);
        if (storedReq != null) {
            if (storedReq.equals("/"))
                storedReq = "";
            else if (storedReq.startsWith("/"))
                storedReq = storedReq.substring(1);
        } else {
            storedReq = "";
        }
        return storedReq;
    }
259928
private URL convertRequestToUrl(InternalRequest request) {
        String resourcePath = HttpUtils.normalizePath(request.getUri().getPath());

        // Removed the padding "/" that was already added into the request's resource path.
        if (resourcePath.startsWith("/")) {
            resourcePath = resourcePath.substring(1);
        }

        // Some http client libraries (e.g. Apache HttpClient) cannot handle
        // consecutive "/"s between URL authority and path components.
        // So we escape "////..." into "/%2F%2F%2F...", in the same way as how
        // we treat consecutive "/"s in AmazonS3Client#presignRequest(...)
        String urlPath = "/" + resourcePath;
        urlPath = urlPath.replaceAll("(?<=/)/", "%2F");
        String urlString = this.getEndpoint() + urlPath;

        boolean firstParam = true;
        for (String param : request.getParameters().keySet()) {
            if (firstParam) {
                urlString += "?";
                firstParam = false;
            } else {
                urlString += "&";
            }

            String value = request.getParameters().get(param);
            urlString += param + "=" + HttpUtils.normalize(value);
        }

        String authorization = request.getHeaders().get(Headers.AUTHORIZATION);
        if (authorization != null) {
            if (firstParam) {
                urlString += "?";
            } else {
                urlString += "&";
            }
            urlString += "authorization" + "=" + HttpUtils.normalize(authorization);
        }

        try {
            return new URL(urlString);
        } catch (MalformedURLException e) {
            throw new BceClientException("Unable to convert request to well formed URL: " + e.getMessage(), e);
        }
    }
1314186
function getQueryString(url){
	if(url.indexOf('%')!==-1)  url = decodeURIComponent(url);
	return parse_info(url.substr(url.indexOf('?')+1,url.length-url.indexOf('?')-1));
}
1323931
def _redirect_url(request):
    

    next = request.GET.get(REDIRECT_FIELD_NAME)

    if not next:
        if settings.CAS_IGNORE_REFERER:
            next = settings.CAS_REDIRECT_URL
        else:
            next = request.META.get('HTTP_REFERER', settings.CAS_REDIRECT_URL)

        host = request.get_host()
        prefix = (('http://', 'https://')[request.is_secure()] + host)

        if next.startswith(prefix):
            next = next[len(prefix):]

    return next
214572
function getReferrerUrl(bidderRequest) {
  let referer = '';
  if (bidderRequest && bidderRequest.refererInfo) {
    referer = encodeURIComponent(bidderRequest.refererInfo.referer);
  }
  return referer;
}
538783
def referrer_uri(self, value):
        
        if value == self._defaults['referrerUri'] and 'referrerUri' in self._values:
            del self._values['referrerUri']
        else:
            self._values['referrerUri'] = value
973830
String toUrl(Auth.UrlCodex urlCodex) {
        return new StringBuilder(authUrl)
                .append(authUrl.contains("?") ? "&" : "?")
                .append("client_id").append("=").append(urlCodex.encode(clientId))
                .append("&").append("response_type").append("=").append("token")
                .append("&").append("scope").append("=").append(scopesToString(urlCodex))
                .toString();
    }
894682
public String getUrlEncodedQueryString(){
        StringBuilder sb = new StringBuilder();
        for (Entry<String, Object> parameter : parameters.entrySet()){
            if (sb.length() > 0){
                sb.append("&");
            }
            try {
                StringBuilder sb2 = new StringBuilder();
                sb2.append(parameter.getKey());
                sb2.append("=");
                sb2.append(URLEncoder.encode(parameter.getValue().toString(), "UTF-8"));
                sb.append(sb2);
            }
            catch (UnsupportedEncodingException e) {
                System.err.println(e.getMessage());
            }
        }
        for (Entry<String, List> customTrackingParameter : customTrackingParameters.entrySet()){
            for (Object o : customTrackingParameter.getValue()){
                if (sb.length() > 0){
                    sb.append("&");
                }
                try {
                    StringBuilder sb2 = new StringBuilder();
                    sb2.append(URLEncoder.encode(customTrackingParameter.getKey(), "UTF-8"));
                    sb2.append("=");
                    sb2.append(URLEncoder.encode(o.toString(), "UTF-8"));
                    sb.append(sb2);
                }
                catch (UnsupportedEncodingException e) {
                    System.err.println(e.getMessage());
                }
            }
        }
        
        return sb.toString();
    }
1182199
public static String getRequestURL(HttpServletRequest req, boolean includeQueryString) {

	StringBuffer sb = req.getRequestURL();
	int maxpos = sb.indexOf("/", 8);

	if (maxpos > -1) {

	    if (req.isSecure()) {
		if (sb.substring(maxpos - 4, maxpos).equals(":443")) sb.delete(maxpos - 4, maxpos);
	    }
	    else {
		if (sb.substring(maxpos - 3, maxpos).equals(":80")) sb.delete(maxpos - 3, maxpos);
	    }

	    if (includeQueryString && !StringUtil.isEmpty(req.getQueryString())) sb.append('?').append(req.getQueryString());
	}

	return sb.toString();
    }
922132
@Override
    public StringBuffer getRequestURL() {

        StringBuffer sb = new StringBuffer(getScheme());
        sb.append("://");
        // Note: following code required if IPv6 IP host does not contain brackets
        // String host = getTargetHost();
        // if (-1 != host.indexOf(":")) {
        // // wrap brackets around the IPv6 IP address
        // host = "[" + host + "]";
        // }
        // sb.append(host);
        sb.append(getTargetHost());
        sb.append(':');
        sb.append(getTargetPort());
        sb.append(getRequestURI());
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "getRequestURL() returning " + sb.toString());
        }
        return sb;
    }
132262
def referer_url(self, value):
        """"""
        if self._referer_url != value:
            self._token = None
            self._referer_url = value
219722
@Nonnull
  public static StringBuffer getRequestRequestURL (@Nullable final HttpServletRequest aRequest)
  {
    StringBuffer ret = null;
    if (aRequest != null)
      try
      {
        ret = aRequest.getRequestURL ();
      }
      catch (final Exception ex)
      {
        // fall through
        if (isLogExceptions ())
          if (LOGGER.isWarnEnabled ())
            LOGGER.warn ("[ServletHelper] Failed to determine request URL of HTTP request", ex);
      }
    return ret != null ? ret : new StringBuffer ();
  }
486998
protected function getReferralUrl(): string
    {
        return str_replace($this->method, 'referral', $this->url) . '?apiKey=' . substr($this->apiKey, 0, 16);
    }