Returns a list of extra HTTP headers to go along with this request
486401
public final Map<String, String> getHeadersMap() {
        if (networkRequest != null && networkRequest.headers != null) {
            return networkRequest.headers.toMap();
        }
        return Collections.emptyMap();
    }
1338387
def _cors_headers(self, environ):
        """"""
        if isinstance(self.cors_allowed_origins, six.string_types):
            if self.cors_allowed_origins == '*':
                allowed_origins = None
            else:
                allowed_origins = [self.cors_allowed_origins]
        else:
            allowed_origins = self.cors_allowed_origins
        if allowed_origins is not None and \
                environ.get('HTTP_ORIGIN', '') not in allowed_origins:
            return []
        if 'HTTP_ORIGIN' in environ:
            headers = [('Access-Control-Allow-Origin', environ['HTTP_ORIGIN'])]
        else:
            headers = [('Access-Control-Allow-Origin', '*')]
        if environ['REQUEST_METHOD'] == 'OPTIONS':
            headers += [('Access-Control-Allow-Methods', 'OPTIONS, GET, POST')]
        if 'HTTP_ACCESS_CONTROL_REQUEST_HEADERS' in environ:
            headers += [('Access-Control-Allow-Headers',
                         environ['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'])]
        if self.cors_credentials:
            headers += [('Access-Control-Allow-Credentials', 'true')]
        return headers
761803
def get_headers(self):
        """"""

        try:
            return {
                'X-Auth-User': self.job_args['os_user'],
                'X-Auth-Key': self.job_args['os_apikey']
            }
        except KeyError as exp:
            raise exceptions.AuthenticationProblem(
                'Missing Credentials. Error: %s',
                exp
            )
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
877265
def get_headers(self, header_name):
		
		header_name = self.normalize_name(header_name)
		if header_name in self.__headers.keys():
			return tuple(self.__headers[header_name])
1324398
private function getHeaders()
        {
            if(function_exists('apache_request_headers')) {
                return apache_request_headers();
            }
            $headers = array();
            $keys = preg_grep('{^HTTP_}i', array_keys($_SERVER));
            foreach($keys as $val) {
                    $key = repl(' ', '-', ucwords(Inflector::lower(repl('_', ' ', substr($val, 5)))));
                    $headers[$key] = $_SERVER[$val];
                }
            return $headers;
        }
244074
def headers(self):
    
    headers = self.conn.issue_command("Headers")
    res = []
    for header in headers.split("\r"):
      key, value = header.split(": ", 1)
      for line in value.split("\n"):
        res.append((_normalize_header(key), line))
    return res
1064037
def write_headers(self):
        
        hlist = []
        for h in self.headers:
            hlist.append("{}: {}".format(h.key, h.value))
        return hlist
1142978
public ArrayList<Pair<String, String>> extraHeaders() {
        string_string_pair_vector v = e.getExtra_headers();
        int size = (int) v.size();

        ArrayList<Pair<String, String>> l = new ArrayList<>(size);
        for (int i = 0; i < size; i++) {
            string_string_pair p = v.get(i);
            l.add(new Pair<>(p.getFirst(), p.getSecond()));
        }

        return l;
    }
610075
public function getRequestHeaders()
    {
        $headers = array();

        foreach ($this->data->getAll() as $key => $value) {
            if ('HTTP_' === substr($key, 0, 5)) {
                $headers[substr($key, 5)] = $value;
            }
        }

        return $headers;
    }
976785
private HttpUriRequest addDefaultHeaders(HttpUriRequest req) {
        req.addHeader(HttpHeaders.ACCEPT, "*/*");
        req.addHeader(HttpHeaders.CONTENT_TYPE, "application/json");
        return req;
    }
505998
public static function get_headers(): array
	{
		if (function_exists('apache_request_headers')) {
			// we need this to get the actual Authorization: header
			// because apache tends to tell us it doesn't exist
			$headers = apache_request_headers();

			// sanitize the output of apache_request_headers because
			// we always want the keys to be Cased-Like-This and arh()
			// returns the headers in the same case as they are in the
			// request
			$out = [];
			foreach ($headers as $key => $value) {
				$key = str_replace(
					' ',
					'-',
					ucwords(strtolower(str_replace('-', ' ', $key)))
				);
				$out[$key] = $value;
			}
		} else {
			// otherwise we don't have apache and are just going to have to hope
			// that $_SERVER actually contains what we need
			$out = [];
			if (isset($_SERVER['CONTENT_TYPE'])) {
				$out['Content-Type'] = $_SERVER['CONTENT_TYPE'];
			}
			if (isset($_ENV['CONTENT_TYPE'])) {
				$out['Content-Type'] = $_ENV['CONTENT_TYPE'];
			}

			foreach ($_SERVER as $key => $value) {
				if (substr($key, 0, 5) == 'HTTP_') {
					// this is chaos, basically it is just there to capitalize the first
					// letter of every word that is not an initial HTTP and strip HTTP
					// code from przemek
					$key = str_replace(
						' ',
						'-',
						ucwords(strtolower(str_replace('_', ' ', substr($key, 5))))
					);
					$out[$key] = $value;
				}
			}
		}
		return $out;
	}
1300346
def list_available_request_headers(custom_headers:nil)
      response = list_available_request_headers_async(custom_headers:custom_headers).value!
      response.body unless response.nil?
    end
472349
public function getHttpHeaders()
    {
        $headers = [
            'Content-type' => 'application/json',
        ];

        // Add "WWW-Authenticate" header
        //
        // RFC 6749, section 5.2.:
        // "If the client attempted to authenticate via the 'Authorization'
        // request header field, the authorization server MUST
        // respond with an HTTP 401 (Unauthorized) status code and
        // include the "WWW-Authenticate" response header field
        // matching the authentication scheme used by the client.
        // @codeCoverageIgnoreStart
        if ($this->errorType === 'invalid_client' && array_key_exists('HTTP_AUTHORIZATION', $_SERVER) !== false) {
            $authScheme = strpos($_SERVER['HTTP_AUTHORIZATION'], 'Bearer') === 0 ? 'Bearer' : 'Basic';

            $headers['WWW-Authenticate'] = $authScheme . ' realm="OAuth"';
        }
        // @codeCoverageIgnoreEnd
        return $headers;
    }
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
482270
def raw
      headers = http_headers.map { |k, v| "#{k}: #{v}\r\n" }.join
      format "%s %s %s\r\n%s\r\n%s", request_method.upcase, fullpath, env["SERVER_PROTOCOL"], headers, body_string
    end
871731
def headers(self):
        '''  '''
        self.__dict__['headers'] = hdict = HeaderDict()
        hdict.dict = self._headers
        return hdict