get a specific response header
967756
public function getHeader(string $key) {
		// return the header of null if missing
		return isset($this->response['headers'][$key]) ? 
			$this->response['headers'][$key] : null;
	}
1024519
def fetch_header(self):
        """"""
        query = self.query().add_query_parameter(req='header')
        return self._parse_messages(self.get_query(query).content)[0]
880174
private static function getHeaderAndBody($response) {
    $header = self::http_parse_headers(substr($response, 0, strrpos($response,"\r\n\r\n")));
    $body = substr($response, strrpos($response,"\r\n\r\n")+4);

    return array($header,$body);
  }
124185
public function getHeader($name)
    {
        $key = strtolower($name);

        if (isset($this->responseHeader[$key])) {
            if (!isset($this->responseHeader[$key]['name']) &&
                 is_array($this->responseHeader[$key])) {
                $values = array();

                foreach ($this->responseHeader[$key] as $header) {
                    $values[] = $header['value'];
                }

                return $values;
            } else {
                return $this->responseHeader[$key]['value'];
            }
        }

        return;
    }
1271705
def getheader(self, header, default=None):
        '''
        
        '''
        if isinstance(header, str):
            return self.headers.get(header.lower(), default)
        return self.__rawheaders.get(header, default)
1305755
def get_response_headers(self, *args, **kwargs):
        
        if self.response_headers:
            return self._unpack_headers(self.response_headers)
300502
def post_process_response_headers(self, dct):
        
        if not self.response_headers:
            return

        for key, value in self.response_headers.items():
            parts = key.split("-")
            if len(parts) != 3:
                continue
            if parts[0] != "X":
                continue
            if parts[-1] != "Id":
                continue

            dct["{}_id".format(underscore(parts[1]))] = value
437770
function getResponseHeaders(xhr) {
    let raw = xhr.getAllResponseHeaders();
    let parts = raw.replace(/\s+$/, '').split(/\n/);
    for (let i = 0; i < parts.length; i++) {
        parts[i] = parts[i].replace(/\r/g, '').replace(/^\s+/, '').replace(/\s+$/, '');
    }
    return parts;
}
314181
public static String getFirstHeader(String headerName, HttpResponse httpResponse) {
        Header header = httpResponse.getFirstHeader(headerName);
        if (header != null) {
            return header.getValue();
        }
        return null;
    }
851979
def Header(self):
    """"""
    # Call OnGetValue on options.
    _ = [option.OnGetValue() for option in self.options]
    return self.name
19377
def _fetch_response_id(self, response):
        

        headers = response.headers

        if self.HEADER_RESPONSE_ID_UPPER_CASED in headers:
            return headers[self.HEADER_RESPONSE_ID_UPPER_CASED]

        if self.HEADER_RESPONSE_ID_LOWER_CASED in headers:
            return headers[self.HEADER_RESPONSE_ID_LOWER_CASED]

        return self._ERROR_COULD_NOT_DETERMINE_RESPONSE_ID_HEADER;
1182440
function getResponseHeaders($options = array()){
		$options = array_merge(array(
			"as_hash" => false,
			"lowerize_keys" => false
		),$options);

		$this->fetchContent();

		$out = $this->_ResponseHeaders;

		if($options["as_hash"]){
			$headers = explode("\n",$out);
			$out = array();
			foreach($headers as $h){
				if(preg_match("/^([^ ]+):(.*)/",trim($h),$matches)){
					$key = $options["lowerize_keys"] ? strtolower($matches[1]) : $matches[1];
					$out[$key] = trim($matches[2]);
				}
			}
		}

		return $out;
	}
1237912
private static function getResponseHeaders()
    {
        $arh = array();

        // headers_list don't return associative array
        $headers = headers_list();
        foreach ($headers as $header) {
            $header = explode(':', $header);
            $arh[array_shift($header)] = trim(implode(':', $header));
        }

        return $arh;
    }
154711
def headers(self):
        
        try:
            return self._headers
        except AttributeError:
            self._headers = self._response.headers
            return self._headers
1262717
def get_http_response(self):
        """"""
        return _get_response(
            code=self.code,
            body=str(self),
            headers={
                'Content-Type': 'text/plain'
            }
        )
786261
def get_header(self, service_id, version_number, name):
		""""""
		content = self._fetch("/service/%s/version/%d/header/%s" % (service_id, version_number, name))
		return FastlyHeader(self, content)
757779
private String getSimpleHeaderValue(String header, HttpResponse httpResponse, boolean first) {
    if (StringUtils.isBlank(header)) {
      return StringUtils.EMPTY;
    }

    Header h;
    if (first) {
      h = httpResponse.getFirstHeader(header);
    } else {
      h = httpResponse.getLastHeader(header);
    }
    if (h == null) {
      return null;
    }
    return h.getValue();
  }