high_score.py 文件源码

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

项目:frog.tips-api 作者: FROG-TIPS 项目源码 文件源码
def __init__(self, data=None, status=200, content_type=None, converters=None):
        default_content_type = 'application/json;charset=utf-8'
        converters = dict(converters or [])
        converters[default_content_type] = self.convert_application_json

        if content_type is None:
            # If the content type is not explicitly given, detect it
            content_type = request.accept_mimetypes.best_match([default_content_type] + list(converters.keys()))

        try:
            converter = converters[content_type]
        except KeyError:
            converter = converters[default_content_type]

        final_data = converter(data, status, content_type)
        super(BaseApiResponse, self).__init__(final_data, content_type=content_type, status=status)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号