Updates the headers in the associated request.
174461
protected function updateRequest()
    {
        $headers = [];
        foreach ($this->all() as $key => $values) {
            foreach ($values as $value) {
                $headers[] = $key.': '.$value;
            }
        }

        $this->request->setOption(CURLOPT_HTTPHEADER, $headers);
    }
307180
private function updateHttpHeader()
    {
        $this->_httpHeader = HttpHelper::EOL;

        $endpoint = $this->_options->getCurrentEndpoint();
        if (Endpoint::getType($endpoint) !== Endpoint::TYPE_UNIX) {
            $this->_httpHeader .= sprintf('Host: %s%s', Endpoint::getHost($endpoint), HttpHelper::EOL);
        }

        if (isset($this->_options[ConnectionOptions::OPTION_AUTH_TYPE], $this->_options[ConnectionOptions::OPTION_AUTH_USER])) {
            // add authorization header
            $authorizationValue = base64_encode(
                $this->_options[ConnectionOptions::OPTION_AUTH_USER] . ':' .
                $this->_options[ConnectionOptions::OPTION_AUTH_PASSWD]
            );

            $this->_httpHeader .= sprintf(
                'Authorization: %s %s%s',
                $this->_options[ConnectionOptions::OPTION_AUTH_TYPE],
                $authorizationValue,
                HttpHelper::EOL
            );
        }

        if (isset($this->_options[ConnectionOptions::OPTION_CONNECTION])) {
            // add connection header
            $this->_httpHeader .= sprintf('Connection: %s%s', $this->_options[ConnectionOptions::OPTION_CONNECTION], HttpHelper::EOL);
        }

        if ($this->_database === '') {
            $this->_baseUrl = '/_db/_system';
        } else {
            $this->_baseUrl = '/_db/' . urlencode($this->_database);
        }
    }
720509
private void populateRequestHeaders(HttpURLConnection httpUrlConnection, Map<String, String> requestHeaders) {
		
		Set<String> keySet = requestHeaders.keySet();
		Iterator<String> keySetIterator = keySet.iterator();
		while (keySetIterator.hasNext()) {
			String key = keySetIterator.next();
			String value = requestHeaders.get(key);
			httpUrlConnection.setRequestProperty(key, value);
		}
		
		PropertyHelper propertyHelper = PropertyHelper.getInstance();
		String requestSource = propertyHelper.getRequestSource() + propertyHelper.getVersion();
		if(propertyHelper.getRequestSourceHeader() != null){
			httpUrlConnection.setRequestProperty(propertyHelper.getRequestSourceHeader(), requestSource);
		}
		

	}
676975
def add_header(self, name, value):
        '''
        '''
        if self.headers is None:
            self.headers = []
        self.headers.append(dict(Name=name, Value=value))
292386
def add_response_headers(h):
    
    def headers_wrapper(fun):
        def wrapped_function(*args, **kwargs):
            response = fun(*args, **kwargs)
            for k, v in h.iteritems():
                response[k] = v
            return response
        return wrapped_function
    return headers_wrapper
61209
def _update_token(self, request):
        

        # Refresh our source credentials.
        self._source_credentials.refresh(request)

        body = {
            "delegates": self._delegates,
            "scope": self._target_scopes,
            "lifetime": str(self._lifetime) + "s"
        }

        headers = {
            'Content-Type': 'application/json',
        }

        # Apply the source credentials authentication info.
        self._source_credentials.apply(headers)

        self.token, self.expiry = _make_iam_token_request(
            request=request,
            principal=self._target_principal,
            headers=headers,
            body=body)
1052214
function addExtraHeaders(request, headers) {
        for (var name in headers) {
            request.setRequestHeader(name, headers[name]);
        }
    }
1328848
public function update($key, $value)
    {
        if (!empty($this->get($this->normalizeKey($key)))) {
            $this->headers[$this->normalizeKey($key)] = $value;
        }
    }
629074
def remove_headers(request, headers_to_remove):
    
    replacements = [(k, None) for k in headers_to_remove]
    return replace_headers(request, replacements)
811866
def patch(query_url,
              headers: {},
              parameters: {})
      HttpRequest.new(HttpMethodEnum::PATCH,
                      query_url,
                      headers: headers,
                      parameters: parameters)
    end
500438
def __SetBaseHeaders(self, http_request, client):
        """"""
        # TODO(craigcitro): Make the default a little better here, and
        # include the apitools version.
        user_agent = client.user_agent or 'apitools-client/1.0'
        http_request.headers['user-agent'] = user_agent
        http_request.headers['accept'] = 'application/json'
        http_request.headers['accept-encoding'] = 'gzip, deflate'
13361
def headers_to_include_from_request(curr_request):
    '''
        
    '''
    return {
        h: v for h, v in curr_request.META.items() if h in _settings.HEADERS_TO_INCLUDE}
36863
def add(self, key, value):
        """"""
        if key not in self.headers:
            self.headers[key] = []
        self.headers[key].append(value)

        if self.sent_time:
            self.modified_since_sent = True
647984
void setNettyHeaders(io.netty.handler.codec.http.HttpHeaders headers) {
        this.nettyHeaders = headers;
    }
630077
def update_data_request(data_request_id, update_submission_data_request_data, opts = {})
      data, _status_code, _headers = update_data_request_with_http_info(data_request_id, update_submission_data_request_data, opts)
      data
    end
970283
def update(self):
        '''
        
        '''
        conditionalRequestHeader = dict()
        if self.etag is not None:
            conditionalRequestHeader[Consts.REQ_IF_NONE_MATCH] = self.etag
        if self.last_modified is not None:
            conditionalRequestHeader[Consts.REQ_IF_MODIFIED_SINCE] = self.last_modified

        status, responseHeaders, output = self._requester.requestJson(
            "GET",
            self._url.value,
            headers=conditionalRequestHeader
        )
        if status == 304:
            return False
        else:
            headers, data = self._requester._Requester__check(status, responseHeaders, output)
            self._storeAndUseAttributes(headers, data)
            self.__completed = True
            return True
324730
def update_header(self, service_id, version_number, name_key, **kwargs):
		""""""
		body = self._formdata(kwargs, FastlyHeader.FIELDS)
		content = self._fetch("/service/%s/version/%d/header/%s" % (service_id, version_number, name_key), method="PUT", body=body)
		return FastlyHeader(self, content)