def get_doi_from_request(request, method):
    """
    Extract the doi from the request.

    Args:
        request (HTTPRequest): The HTTP request

    Return:
        a str, the DOI

    """
    full_path = request.get_full_path()
    bits = full_path.split(method + '/')
    try:
        return bits[1]
    except IndexError:
        return None