paraproxio.py 文件源码

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

项目:paraproxio 作者: intagger 项目源码 文件源码
def get_file_head(self, url: str) -> Optional[CIMultiDictProxy]:
        """Make a HEAD request to get a 'content-length' and 'accept-ranges' headers."""
        self.log_debug('Getting a HEAD for url: {!s}.'.format(url))
        try:
            async with aiohttp.ClientSession(loop=self._loop) as session:
                async with session.request(hdrs.METH_HEAD, url) as res:  # type: aiohttp.ClientResponse
                    return res.headers
        except Exception as exc:
            self.log_debug("Could not get a HEAD for the {!r}. Error: {!r}.".format(url, exc))
        return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号