def get_oauth_request(request):
    """ Converts a Django request object into an `oauth2.Request` object. """
    headers = {}
    if 'HTTP_AUTHORIZATION' in request.META:
        headers['Authorization'] = request.META['HTTP_AUTHORIZATION']
    return oauth.Request.from_request(request.method, request.build_absolute_uri(request.path), headers,
                                      dict(request.REQUEST))
dataset/ETHPy150Open treeio/treeio/treeio/core/api/auth/utils.py/get_oauth_request/original