sets the Referer header for the request
@param refererValue   : header field value to add
@return : Request Object with referer header value set
179662
public Request referer(String refererValue){
        final String referer = RequestHeaderFields.REFERER.getName();
        return this.setHeader(referer, refererValue);
    }
87809
def add_headers(self, header_name, value, *values):
		
		if self.__ro_flag:
			raise RuntimeError('ro')
		header_name = self.normalize_name(header_name)
		if header_name not in self.__headers.keys():
			self.__headers[header_name] = [value]
		else:
			self.__headers[header_name].append(value)

		for single_value in values:
			self.__headers[header_name].append(single_value)
269948
def convert_http_request(request, referrer_host=None):
    '''
    '''
    new_request = urllib.request.Request(
        request.url_info.url,
        origin_req_host=referrer_host,
    )

    for name, value in request.fields.get_all():
        new_request.add_header(name, value)

    return new_request
1033187
public function setReferrer($referrer)
    {
        if(!($referrer instanceof HttpUrlInterface)) {
            $referrer = $this->getObject('lib:http.url', array('url' => $referrer));
        }

        $this->_referrer = $referrer;

        return $this;
    }
269663
@Override
    public void setRequestHeader(String headerName, String headerValue) {
        Header header = new Header(headerName, headerValue);
        setRequestHeader(header);
    }
725559
function formatReferer(ctx, pathname, rootPath) {
  const query = ctx.query;
  let referer = query.redirect || ctx.get('referer') || rootPath;
  if (referer[0] !== '/') {
    // ignore protocol://xxx/abc
    referer = rootPath;
  } else if (referer.indexOf(pathname) === 0) {
    // referer start with loginPath or logoutPath, just redirect to rootPath
    referer = rootPath;
  }
  return referer;
}
237192
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],"","","",""))

        if referer_url is None:
            parsed_org = urlparse(self._org_url)
            self._referer_url = parsed_org.netloc

            url = '{}/portals/self'.format( self._url)

        parameters = {
            'f': 'json'
        }
        portal_info = self._post(url=url,
                                 param_dict=parameters,
                                 securityHandler=self,
                                 proxy_port=self._proxy_port,
                                 proxy_url=self._proxy_url)
        if 'user' in portal_info:
            if 'username' in portal_info['user']:
                self._username = portal_info['user']['username']
1264449
def referer(self, value):
        """"""
        if value is not None and \
           self._referer is not None and \
           self._referer.lower() != value.lower():
            self._referer = value
1231817
def post(self, ddata, url=SETUP_ENDPOINT, referer=SETUP_ENDPOINT):
        """"""
        headers = HEADERS.copy()
        if referer is None:
            headers.pop('Referer')
        else:
            headers['Referer'] = referer

        # append csrftoken
        if 'csrfmiddlewaretoken' not in ddata.keys():
            ddata['csrfmiddlewaretoken'] = self._parent.csrftoken

        req = self._parent.client.post(url, headers=headers, data=ddata)
        if req.status_code == 200:
            self.update()
424017
public Hop header(String headerName, String headerValue) {

		Assert.hasText(headerName, "headerName must not be null or empty!");

		if (this.headers == HttpHeaders.EMPTY) {

			HttpHeaders newHeaders = new HttpHeaders();
			newHeaders.add(headerName, headerValue);

			return new Hop(this.rel, this.parameters, newHeaders);
		}

		this.headers.add(headerName, headerValue);
		return this;
	}
888685
public B addHeader(final String headerName, final String headerValue) {
        httpParams.addHeader(headerName, headerValue);
        return self();
    }
587281
def set(self, value):
        '''
        
        '''
        with self._reference.get_lock():
            self._reference.value = value
            return value
617897
def header_add(self, name, value):
        
        self._set('add-header', '%s: %s' % (name, value), multi=True)

        return self._section
1283006
def add_headerReference(self, type_, rId):
        
        headerReference = self._add_headerReference()
        headerReference.type_ = type_
        headerReference.rId = rId
        return headerReference
86593
public void addHeaderValue(String headerName, String headerValue) {
		Objects.requireNonNull(headerName, "headerName cannot be null");
		Objects.requireNonNull(headerValue, "headerValue cannot be null");

		getHeaderValues(headerName).add(headerValue);
	}
732158
public function getReferer() : ?Url
    {
        $referer = $this->getFirstHeader('Referer');

        if ($referer === null) {
            return null;
        }

        try {
            return new Url($referer);
        } catch (\InvalidArgumentException $e) {
            return null;
        }
    }
1184658
def get_response(url, referer = nil)
      full_path = url.query.nil? ? url.path : "#{url.path}?#{url.query}"

      opts = {}
      opts['User-Agent'] = user_agent if user_agent
      opts['Referer'] = referer.to_s if referer
      opts['Cookie'] = @cookie_store.to_s unless @cookie_store.empty? || (!accept_cookies? && @opts[:cookies].nil?)

      retries = 0
      begin
        start = Time.now()
        # format request
        req = Net::HTTP::Get.new(full_path, opts)
        # HTTP Basic authentication
        req.basic_auth url.user, url.password if url.user
        response = connection(url).request(req)
        finish = Time.now()
        response_time = ((finish - start) * 1000).round
        @cookie_store.merge!(response['Set-Cookie']) if accept_cookies?
        return response, response_time
      rescue Timeout::Error, Net::HTTPBadResponse, EOFError => e
        puts e.inspect if verbose?
        refresh_connection(url)
        retries += 1
        retry unless retries > 3
      end
    end