如何在Python中模拟请求的响应

2024-09-25 04:24:10 发布

您现在位置:Python中文网/ 问答频道 /正文

代码如下:

response = requests.get("xyx@.com", stream=True)
data = response.raw.read()

我想模拟“response.raw.read()”,我知道模拟requests.get的几个选项,但我需要模拟第二行代码


Tags: 代码comtruereaddatastreamgetraw