小编Sid*_*ath的帖子

如何在python 3中发出https请求

我想使用https协议从服务器下载文件。我应该怎么做呢?这是我使用http的基本代码

response=requests.get('http://url',stream='True')

handle=open('dest_file.txt','wb')
for chunk in response.iter_content(chunk_size=512):
    if chunk:  # filter out keep-alive new chunks
        handle.write(chunk)

handle.close()  
Run Code Online (Sandbox Code Playgroud)

请求模块也可以用于https吗?

python python-requests

5
推荐指数
1
解决办法
4868
查看次数

标签 统计

python ×1

python-requests ×1