def METHOD_NAME(http_method, method, data, extra):
    assert "HTTP_DJNG_REMOTE_METHOD" not in extra, "use 'method' arg"
    if method is not None:
        extra["HTTP_DJNG_REMOTE_METHOD"] = method
    extra.setdefault("HTTP_X_REQUESTED_WITH", "XMLHttpRequest")
    factory = RequestFactory()
    make_request = getattr(factory, http_method)
    request = make_request('/', data, **extra)
    view = RmiView.as_view()
    return view(request)