response.py 文件源码

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

项目:Projects 作者: it2school 项目源码 文件源码
def _decode(self, data, decode_content, flush_decoder):
        """
        Decode the data passed in and potentially flush the decoder.
        """
        try:
            if decode_content and self._decoder:
                data = self._decoder.decompress(data)
        except (IOError, zlib.error) as e:
            content_encoding = self.headers.get('content-encoding', '').lower()
            raise DecodeError(
                "Received response with content-encoding: %s, but "
                "failed to decode it." % content_encoding, e)

        if flush_decoder and decode_content:
            data += self._flush_decoder()

        return data
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号