首页 > 解决方案 > 如何在 Python 中模拟请求的响应

问题描述

下面是代码:

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

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

标签: pythonpython-3.7

解决方案


推荐阅读