Produce the header of request as a string based on a PSR Request.
169150
protected function transformRequestHeadersToString(RequestInterface $request): string
    {
        $message = vsprintf('%s %s HTTP/%s', [
            strtoupper($request->getMethod()),
            $request->getRequestTarget(),
            $request->getProtocolVersion(),
        ])."\r\n";

        foreach ($request->getHeaders() as $name => $values) {
            $message .= $name.': '.implode(', ', $values)."\r\n";
        }

        $message .= "\r\n";

        return $message;
    }
652560
def header_output(self):
        '''
        '''
        result = []
        for key in self.keys():
            result.append(key + '=' + self.get(key).value)
        return '; '.join(result)
619309
def get_header(request, header_service):
    
    service = request.META.get('HTTP_{}'.format(header_service), b'')
    if isinstance(service, str):
        # Work around django test client oddness
        service = service.encode(HTTP_HEADER_ENCODING)
    return service
1262579
def headers_to_str_headers(headers):
    '''
    
    '''
    ret = []

    if isinstance(headers, collections_abc.Mapping):
        h = headers.items()
    else:
        h = headers

    if six.PY2:  #pragma: no cover
        return h

    for tup in h:
        k, v = tup
        if isinstance(k, six.binary_type):
            k = k.decode('iso-8859-1')
        if isinstance(v, six.binary_type):
            v = v.decode('iso-8859-1')
        ret.append((k, v))
    return ret
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
693801
def get_ebuio_headers(request):
    """"""

    retour = {}

    for (key, value) in request.headers:
        if key.startswith('X-Plugit-'):
            key = key[9:]

            retour[key] = value

    return retour
537331
def parse_headers(self, req, name, field):
        """"""
        # Use req.get_headers rather than req.headers for performance
        return req.get_header(name, required=False) or core.missing
131896
def get_headers(params, boundary):
    """"""
    headers = {}
    boundary = urllib.quote_plus(boundary)
    headers['Content-Type'] = "multipart/form-data; boundary=%s" % boundary
    headers['Content-Length'] = str(get_body_size(params, boundary))
    return headers
1352501
def get_header(self, request):
        
        header = request.META.get('HTTP_AUTHORIZATION')

        if isinstance(header, str):
            # Work around django test client oddness
            header = header.encode(HTTP_HEADER_ENCODING)

        return header
269064
def _header_string(basis_dict):
    '''
    '''

    tw = textwrap.TextWrapper(initial_indent='', subsequent_indent=' ' * 20)

    header = '-' * 70 + '\n'
    header += ' Basis Set Exchange\n'
    header += ' Version ' + version() + '\n'
    header += ' ' + _main_url + '\n'
    header += '-' * 70 + '\n'
    header += '   Basis set: ' + basis_dict['name'] + '\n'
    header += tw.fill(' Description: ' + basis_dict['description']) + '\n'
    header += '        Role: ' + basis_dict['role'] + '\n'
    header += tw.fill('     Version: {}  ({})'.format(basis_dict['version'],
                                                      basis_dict['revision_description'])) + '\n'
    header += '-' * 70 + '\n'

    return header
502123
def get_header(results):
    ''''''
    ret = ['name', ]
    values = next(iter(results.values()))
    for k, v in values.items():
        if isinstance(v, dict):
            for metric in v.keys():
                ret.append('%s:%s' % (k, metric))
        else:
            ret.append(k)
    return ret
995653
private function buildHeaderResponse()
    {
        foreach (explode(
            "\n",
            substr($this->output, 0, $this->info['header_size'])
        ) as $val) {
            $val = trim($val);
            if (! empty($val)) {
                $this->headerResponse[] = $val;
            }
        }
        $this->output = substr($this->output, $this->info['header_size']);
    }
1275555
def create_header(self, service_id, version_number, name, destination, source, _type=FastlyHeaderType.RESPONSE, action=FastlyHeaderAction.SET, regex=None, substitution=None, ignore_if_set=None, priority=10, response_condition=None, cache_condition=None, request_condition=None):
		body = self._formdata({
			"name": name,
			"dst": destination,
			"src": source,
			"type": _type,
			"action": action,
			"regex": regex,
			"substitution": substitution,
			"ignore_if_set": ignore_if_set,
			"priority": priority,
			"response_condition": response_condition,
			"request_condition": request_condition,
			"cache_condition": cache_condition,
		}, FastlyHeader.FIELDS)
		""""""
		content = self._fetch("/service/%s/version/%d/header" % (service_id, version_number), method="POST", body=body)
		return FastlyHeader(self, content)
272840
@Sensitive
    public static String getHeader(HttpServletRequest req, String key) {
        HttpServletRequest sr = getWrappedServletRequestObject(req);
        return sr.getHeader(key);
    }
787352
def get_resp(url):
    """"""
    try:
        headers = {'User-Agent': random.choice(USER_AGENTS)}
        try:
            request = requests.get(url, headers=headers, proxies=get_proxies())
        except MissingSchema:
            url = add_protocol(url)
            request = requests.get(url, headers=headers, proxies=get_proxies())
        return lh.fromstring(request.text.encode('utf-8') if PY2 else request.text)
    except Exception:
        sys.stderr.write('Failed to retrieve {0}.\n'.format(url))
        raise
107599
protected String getHeader( ITransaction transaction,
                                String path,
                                HttpServletResponse resp,
                                HttpServletRequest req ) {
        return "<h1>Content of folder " + path + "</h1>";
    }
1005434
def get_headers(environ):
    
    for key, value in compat.iteritems(environ):
        key = str(key)
        if key.startswith("HTTP_") and key not in ("HTTP_CONTENT_TYPE", "HTTP_CONTENT_LENGTH"):
            yield key[5:].replace("_", "-").lower(), value
        elif key in ("CONTENT_TYPE", "CONTENT_LENGTH"):
            yield key.replace("_", "-").lower(), value