def METHOD_NAME() -> RequestWants:
    """Get request_wants from the request."""
    # Flask 2.0 deprecated use of _request_ctx_stack.top and recommends using `g`.
    # However, `g` is not suitable for us as we must cache results for a request only.
    # Therefore we stick it in the request object itself.
    if has_request_context():
        # pylint: disable=protected-access
        wants = getattr(request, '_request_wants', None)
        if wants is None:
            wants = RequestWants()
            request._request_wants = wants  # type: ignore[attr-defined]
        return wants
    # Return an empty handler
    return RequestWants()