@staticmethod
    def json_body(req):
        if not req.content_length:
            return {}

        try:
            raw_json = req.stream.read()
        except Exception:
            raise freezer_api_exc.BadDataFormat('Empty request body. A valid '
                                                'JSON document is required.')
        try:
            json_data = json.loads(raw_json, 'utf-8')
        except __HOLE__:
            raise falcon.HTTPError(falcon.HTTP_753,
                                   'Malformed JSON')
        return json_data
dataset/ETHPy150Open openstack/freezer-api/freezer_api/api/common/resource.py/BaseResource.json_body