

def on_post(self, req, resp):
    doc = self.json_body(req)
    if (not doc):
        raise freezer_api_exc.BadDataFormat(message='Missing request body')
    user_id = req.get_header('X-User-ID')
    session_id = self.db.add_session(user_id=user_id, doc=doc)
    resp.status = falcon.HTTP_201
    resp.body = {
        'session_id': session_id,
    }

dataset/ETHPy150Open openstack/freezer-api/freezer_api/api/v1/sessions.py SessionsCollectionResource.on_post/original