def METHOD_NAME(request, *args, **kwargs):
    # cdodge: fix postback errors in CMS. The POST 'content-type' header can include additional information
    # e.g. 'charset', so we can't do a direct string compare
    if "application/json" in request.META.get("CONTENT_TYPE", "") and request.body:
        try:
            request.json = json.loads(request.body.decode("utf8"))
        except ValueError:
            return JsonResponseBadRequest({"error": "Invalid JSON"})
    else:
        request.json = {}
    return view_function(request, *args, **kwargs)