Create a new request with added headers

        Parameters
        ----------
        headers: Mapping
            the headers to add
174288
def with_headers(self, headers):
        
        return self.replace(headers=_merge_maps(self.headers, headers))
261402
def add_header(self, key, value):
        

        assert isinstance(key, str), 'header key must be of type str'
        assert isinstance(value, str), 'header value must be of type str'
        self.headers[key] = value
759853
def add(self, registry):
        
        # POST
        payload = self.formatter.marshall(registry)
        r = requests.post(self.path, data=payload, headers=self.headers)
1246698
def add_header(self, name, value):
        
        self._headers.setdefault(_hkey(name), []).append(_hval(value))
147302
def _prepare_headers(
            self,
            headers: Optional[LooseHeaders]) -> 'CIMultiDict[str]':
        
        # Convert headers to MultiDict
        result = CIMultiDict(self._default_headers)
        if headers:
            if not isinstance(headers, (MultiDictProxy, MultiDict)):
                headers = CIMultiDict(headers)
            added_names = set()  # type: Set[str]
            for key, value in headers.items():
                if key in added_names:
                    result.add(key, value)
                else:
                    result[key] = value
                    added_names.add(key)
        return result
248638
def request(self, url, params={}, headers={}):
        
        # Generate current config. Merge in any given headers
        cur_config = self.config.copy()
        if 'headers' in cur_config:
            cur_config['headers'] = cur_config['headers'].copy()
            cur_config['headers'].update(headers)
        else:
            cur_config['headers'] = headers

        with closing(requests.get(url, params=params, **cur_config)) as response:
            if response.status_code == requests.codes.OK:
                # Prepare the temp file. xml content will be
                # stored in a binary file, json in a textfile.
                if (response.headers.get('Content-Type')
                        and ('json' in response.headers['Content-Type'])):
                    enc, fmode = response.encoding, 'w+t'
                else:
                    enc, fmode = None, 'w+b'
                # Create temp file ensuring 2to3 compatibility
                if str_type == str:  # we are on py3
                    source = STF(
                        max_size=self.max_size, mode=fmode, encoding=enc)
                else:
                    # On py27 we must omit the 'encoding' kwarg
                    source = STF(max_size=self.max_size, mode=fmode)
                for c in response.iter_content(chunk_size=1000000,
                                               decode_unicode=bool(enc)):
                    source.write(c)

            else:
                source = None
            code = int(response.status_code)
            if 400 <= code <= 499:
                raise response.raise_for_status()
            return source, response.url, response.headers, code
763934
def put(self, url, headers=None, body=None, kwargs=None):
        
        return self._request(
            method='put',
            url=url,
            headers=headers,
            body=body,
            kwargs=kwargs
        )
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
7281
def add_table(self, address, has_headers):
        
        if address is None:
            return None
        params = {
            'address': address,
            'hasHeaders': has_headers
        }
        url = self.build_url(self._endpoints.get('add_table'))
        response = self.session.post(url, data=params)
        if not response:
            return None
        return self.table_constructor(parent=self, **{self._cloud_data_key: response.json()})
1328846
private void addHeadersToContext(final HttpHeaders headers) {
        for (HttpHeader header : headers.all()) {
            final String rawKey = header.key();
            final String transformedKey = rawKey.replaceAll("-", "");
            context.put("requestHeader".concat(transformedKey), header.values()
                    .toString());
        }
    }
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)
863189
def create(self, parameters):
        
        response = self._client.session.post(
            '{url}/new'.format(url=self.endpoint_url), data=parameters
        )
        return self.process_response(response)
754085
def _add_custom_headers(self, dct):
        
        if self.client_id is None:
            self.client_id = os.environ.get("CLOUD_QUEUES_ID")
        if self.client_id:
            dct["Client-ID"] = self.client_id
676975
def add_header(self, name, value):
        '''
        '''
        if self.headers is None:
            self.headers = []
        self.headers.append(dict(Name=name, Value=value))
831324
public OkRequest<T> headers(final Map<String, String> headers) {
        if (!headers.isEmpty())
            for (Map.Entry<String, String> header : headers.entrySet())
                header(header);
        return this;
    }
217193
def put(self, uri_relative, request_bytes, custom_headers):
        

        return self._request(
            self._METHOD_PUT,
            uri_relative,
            request_bytes,
            {},
            custom_headers
        )
1348766
def put(query_url,
            headers: {},
            parameters: {})
      HttpRequest.new(HttpMethodEnum::PUT,
                      query_url,
                      headers: headers,
                      parameters: parameters)
    end