Retrieves the value of a header
429822
def get_header(self, name, default=None):
        
        return self._handler.headers.get(name, default)
312349
private static String getHeaderInfo(String name, String headerLine) {
        String[] fields = headerLine.split("[\t ]");
        for (String field : fields) {
            if (field.startsWith(name + "=")) {
                String[] subfields = field.split("=");
                return subfields[1];
            }
        }
        return null;
    }
540230
function getHeader (header, field) {
  const re = new RegExp(`(?:\\r\\n)${field}: *([a-zA-z0-9 /,:;=-]*)`, 'gi')
  return re.exec(header, field)
}
1173097
def _parseHeaderValue(self, header_value):
        
        values = header_value.split(';', 1)
        if len(values) == 1:
            # There's no extra info -- return the main value and an empty dict
            return values[0], {}
        main_value, extra_values = values[0], values[1].split(';')
        extra_dict = {}
        for value_string in extra_values:
            try:
                key, value = value_string.split('=', 1)
                extra_dict[key.strip()] = value.strip()
            except ValueError:
                # Can't unpack it -- must be malformed. Ignore
                pass
        return main_value, extra_dict
298303
def assertHeader(self, name, value=None, *args, **kwargs):
        
        return name in self.raw_headers and (
            True if value is None else self.raw_headers[name] == value)
278807
public String getHeader(String headerName) {
        List<String> headers = null;
        for (String h : headers().keySet()) {
            if (headerName.equalsIgnoreCase(h)) {
                headers = headers().get(h);
                break;
            }
        }
        if (headers == null || headers.isEmpty()) {
            return null;
        }
        return headers.get(0);
    }
622195
function getHeader(data, headerStart)
{
  // 'start' position of the header.
  let start = headerStart;
  // 'end' position of the header.
  let end = 0;
  // 'partial end' position of the header.
  let partialEnd = 0;

  // End of message.
  if (data.substring(start, start + 2).match(/(^\r\n)/))
  {
    return -2;
  }

  while (end === 0)
  {
    // Partial End of Header.
    partialEnd = data.indexOf('\r\n', start);

    // 'indexOf' returns -1 if the value to be found never occurs.
    if (partialEnd === -1)
    {
      return partialEnd;
    }

    if (!data.substring(partialEnd + 2, partialEnd + 4).match(/(^\r\n)/) && data.charAt(partialEnd + 2).match(/(^\s+)/))
    {
      // Not the end of the message. Continue from the next position.
      start = partialEnd + 2;
    }
    else
    {
      end = partialEnd;
    }
  }

  return end;
}
1271705
def getheader(self, header, default=None):
        '''
        
        '''
        if isinstance(header, str):
            return self.headers.get(header.lower(), default)
        return self.__rawheaders.get(header, default)
1083296
public function getHeader(string $header, string $defaultValue = null)
    {
        $header = strtolower($header);
        if (isset($this->headers[$header])) {
            return $this->headers[$header];
        }
        return $defaultValue;
    }
373334
def get_header(self, hdrclass, returnval=None):
        '''
        
        '''
        if isinstance(hdrclass, str):
            return self.get_header_by_name(hdrclass)

        for hdr in self._headers:
            if isinstance(hdr, hdrclass):
                return hdr
        return returnval
1011091
def get(self):
        
        header = {}
        if self.key is not None and self.value is not None:
            header[self.key] = self.value
        return header
898252
public String value(String name) {
        final HttpHeader header = getHeader(name);
        return header == null ? null : header.value();
    }
1021440
public String getHeader(String name, String defaultValue) {
        return header.getValue(name, defaultValue);
    }
137773
def parse_headers(self, req, name, field):
        """"""
        return get_value(req.headers, name, field)
1132417
def _get_header(self):
        """"""
        out = self._get_row(self.labels)
        out += "\n"
        out += self._get_row(["---"] * len(self.labels))  # line below headers
        return out
418416
public String getHeader(String name)
  {
    if (_header != null)
    {
      String strVal = _header.getHeader(name);
      if (strVal != null)
        return strVal;
    }
    if (this.headerTable != null)
    {
      int i = 0;
      for (Object obj : headerTable[0])
      {
        String strVal = (String) obj;
        if (name.equals(strVal))
        {
          return (String) headerTable[1].get(i);
        }
        i++;
      }
    }
    return null;
  }
287110
def get_from_headers(request, key):
    
    value = request.headers.get(key)
    return to_native(value)