request.py 文件源码

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

项目:sdining 作者: Lurance 项目源码 文件源码
def _load_stream(self):
        """
        Return the content body of the request, as a stream.
        """
        meta = self._request.META
        try:
            content_length = int(
                meta.get('CONTENT_LENGTH', meta.get('HTTP_CONTENT_LENGTH', 0))
            )
        except (ValueError, TypeError):
            content_length = 0

        if content_length == 0:
            self._stream = None
        elif not self._request._read_started:
            self._stream = self._request
        else:
            self._stream = six.BytesIO(self.body)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号