import json


def parse_request(request):
    """
    Parses JSON bodies safely.
    """
    try:
        body = json.loads(request.body.decode("utf-8"))
        return body
    except Exception:
        return None