wsgi.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:meteos 作者: openstack 项目源码 文件源码
def action_peek_json(body):
    """Determine action to invoke."""

    try:
        decoded = jsonutils.loads(body)
    except ValueError:
        msg = _("cannot understand JSON")
        raise exception.MalformedRequestBody(reason=msg)

    # Make sure there's exactly one key...
    if len(decoded) != 1:
        msg = _("too many body keys")
        raise exception.MalformedRequestBody(reason=msg)

    # Return the action and the decoded body...
    return list(decoded.keys())[0]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号