__init__.py 文件源码

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

项目:armada 作者: att-comdev 项目源码 文件源码
def req_yaml(self, req):
        if req.content_length is None or req.content_length == 0:
            return None

        raw_body = req.stream.read(req.content_length or 0)

        if raw_body is None:
            return None

        try:
            return yaml.safe_load_all(raw_body.decode('utf-8'))
        except yaml.YAMLError as jex:
            self.error(
                req.context,
                "Invalid YAML in request: \n%s" % raw_body.decode('utf-8'))
            raise Exception(
                "%s: Invalid YAML in body: %s" % (req.path, jex))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号