'Retrieve the raw string value for the given header.
Args:
name (str): Header name, case-insensitive (e.g., \'Content-Type\')
Keyword Args:
required (bool): Set to ``True`` to raise
``HTTPBadRequest`` instead of returning gracefully when the
header is not found (default ``False``).
default (any): Value to return if the header
is not found (default ``None``).
Returns:
str: The value of the specified header if it exists, or
the default value if the header is not found and is not
required.
Raises:
HTTPBadRequest: The header was not found in the request, but
it was required.'

def get_header(self, name, required=False, default=None):

    wsgi_name = name.upper().replace('-', '_')
    try:
        return self.env[('HTTP_' + wsgi_name)]
    except KeyError:
        if (wsgi_name in WSGI_CONTENT_HEADERS):
            try:
                return self.env[wsgi_name]
            except KeyError:
                pass
        if (not required):
            return default
        raise errors.HTTPMissingHeader(name)
