def mbv_command(payload, method="post"):
    request = RequestFactory().generic(method, "/")
    if method == "post":
        request._body = json.dumps(payload).encode("UTF-8")
    else:
        request.GET = payload
    mbv = MediaBrowserView.as_view()
    return json.loads(mbv(request).content.decode("UTF-8"))
def _mbv_command(shop, user, payload, method="post"):
    request = RequestFactory().generic(method, "/")
    request.user = user
    request.session = {}
    set_shop(request, shop)
    if method == "post":
        request._body = json.dumps(payload).encode("UTF-8")
    else:
        request.GET = payload

    mbv = MediaBrowserView.as_view()
    return json.loads(mbv(request).content.decode("UTF-8"))