def get_from_headers ( request , key ) : value = request . headers . get ( key ) return to_native ( value )
how to get the value of a header in python requests
Try to read a value named key from the headers .
def get_from_headers(request, key):
    """Try to read a value named ``key`` from the headers.
    """
    value = request.headers.get(key)
    return to_native(value)