📜  python写请求响应文本文件 - Python代码示例

📅  最后修改于: 2022-03-11 14:46:08.753000             🧑  作者: Mango

代码示例1
import requests

apiUrl = "https://"
filename = "test.txt"
chunk_size = 100

response = requests.get( apiUrl )

with open(filename, 'wb') as fd:
    for chunk in response.iter_content(chunk_size):
        fd.write(chunk)