Converts the object back into an HTTP header.
975897
def to_header(self):
        """"""
        if self.date is not None:
            return http_date(self.date)
        if self.etag is not None:
            return quote_etag(self.etag)
        return ""
1201313
def to_header(self):
        """"""
        ranges = []
        for begin, end in self.ranges:
            if end is None:
                ranges.append("%s-" % begin if begin >= 0 else str(begin))
            else:
                ranges.append("%s-%s" % (begin, end - 1))
        return "%s=%s" % (self.units, ",".join(ranges))
323897
function getResponseHeader(sHeaderName) {
		var sResponseHeader;

		sHeaderName = sHeaderName.toLowerCase();

		for (sResponseHeader in this.headers) {
			if (sResponseHeader.toLowerCase() === sHeaderName) {
				return this.headers[sResponseHeader];
			}
		}
	}
804993
def http_method(self, data):
        """"""
        data = data.upper()
        if data in ['DELETE', 'GET', 'POST', 'PUT']:
            self._http_method = data

            # set content type for commit methods (best guess)
            if self._headers.get('Content-Type') is None and data in ['POST', 'PUT']:
                self.add_header('Content-Type', 'application/json')
        else:
            raise AttributeError(
                'Request Object Error: {} is not a valid HTTP method.'.format(data)
            )
121600
def create_header(cls, request_id=None):
        ''' 

        '''
        header = {
            'msgid'   : bkserial.make_id(),
            'msgtype' : cls.msgtype
        }
        if request_id is not None:
            header['reqid'] = request_id
        return header
96518
def headers_for_url(cls, url):
        """"""
        response = cls.http_request(url, method='HEAD')
        if response.status != 200:
            cls.raise_http_error(response)

        return Resource.headers_as_dict(response)
401545
def _header_getter(self, uri, headers):
        

        # perform Object HEAD request
        resp = self.http.head(url=uri, headers=headers)
        self._resp_exception(resp=resp)
        return resp
405972
public T headers(Map<String, Object> headers) {
        getMessageContentBuilder().getMessageHeaders().putAll(headers);
        return self;
    }
1085233
def to_header_str(self):
        
        h_parts = []
        if self.root:
            h_parts.append(ROOT + '=' + self.root)
        if self.parent:
            h_parts.append(PARENT + '=' + self.parent)
        if self.sampled is not None:
            h_parts.append(SAMPLE + '=' + str(self.sampled))
        if self.data:
            for key in self.data:
                h_parts.append(key + '=' + self.data[key])

        return HEADER_DELIMITER.join(h_parts)
1172917
def from_request(cls, request):
        """"""
        request_headers = HeaderDict()
        other_headers = ['CONTENT_TYPE', 'CONTENT_LENGTH']

        for header, value in iteritems(request.META):
            is_header = header.startswith('HTTP_') or header in other_headers
            normalized_header = cls._normalize_django_header_name(header)

            if is_header and value:
                request_headers[normalized_header] = value

        return request_headers
640378
def cleanup_headers(self):
        """"""
        headers = {'Content-Type': 'application/json'}
        headers['Authorization'] = self.__token
        self.__headers = headers
        self.__params = {}
1110354
def wrap(http_response)
      OpenStruct.new.tap do |obj|
        obj.code    = http_response.code.to_i
        obj.body    = http_response.body
        obj.headers = {}
        http_response.each_header{|k,v| obj.headers[k] = v }
      end
    end
1029753
def headers(self, url):
        
        if self._token and url.lower().startswith('https'):
            return {'Authorization': 'Bearer {}'.format(self._token)}
        else:
            return None
1271705
def getheader(self, header, default=None):
        '''
        
        '''
        if isinstance(header, str):
            return self.headers.get(header.lower(), default)
        return self.__rawheaders.get(header, default)
210364
public Request header(String key, String value) {
        this.headers.put(key, value);
        return this;
    }
597783
@Override
	public HttpResponse head() {
		BasicHttpResponse response = new BasicHttpResponse(this.response.getStatusLine());
		Header[] allHeaders = this.response.getAllHeaders();
		for (Header allHeader : allHeaders)
			response.addHeader(allHeader);
		response.setEntity(new ByteArrayEntity(new byte[]{}));
		return response;
	}
242234
def http_headers
      req_headers = self.reject {|k,v| !k.start_with? "HTTP_" }
      normalized = req_headers.map do |key, value|
        new_key = key.sub("HTTP_",'').split('_').map(&:capitalize).join('-')
        [new_key, value]
      end
      Hash[normalized]
    end