def request_json(self):
"""Tries to parse JSON body (with caching).
Raises proper exception on problems.
"""
try:
return flask.request.get_json(force=True)
except werkzeug.exceptions.BadRequest as exc:
LOG.error("Cannot process user request: %s", exc)
raise exceptions.NotAcceptable() from exc
评论列表
文章目录