import json


def load_body(request):
    """load the body of a request.
    """
    if isinstance(request.body, bytes):
        payload = json.loads(request.body.decode("utf-8"))
    else:
        payload = json.loads(request.body)
    return payload