def get_json_body(self):
        if not self.request.body:
            return None
        body = self.request.body.strip().decode('utf-8')
        try:
            model = json.loads(body)
        except Exception:
            self.log.debug("Bad JSON: %r", body)
            self.log.error("Couldn't parse JSON", exc_info=True)
            raise web.HTTPError(400, 'Invalid JSON in body of request')
        return model
Return the body of the request as JSON data.
dataset/ETHPy150Open jupyterhub/jupyterhub/jupyterhub/apihandlers/base.py/APIHandler.get_json_body