(request)
return json.loads(raw_body.decode("utf-8"))
returns the parsed request body, handles gzip encoding
returns the parsed request body, handles gzip encoding
returns the parsed request body handles gzip encoding
def parse_request_body(request):
    """returns the parsed request body, handles gzip encoding"""

    raw_body = request.body
    content_enc = request.META.get("HTTP_CONTENT_ENCODING")

    if content_enc == "gzip":
        raw_body = zlib.decompress(raw_body)

    return json.loads(raw_body.decode("utf-8"))
def parse_request_body ( request ) : raw_body = request . body content_enc = request . META . get ( "HTTP_CONTENT_ENCODING" ) if content_enc == "gzip" : raw_body = zlib . decompress ( raw_body ) return json . loads ( raw_body . decode ( "utf-8" ) )