📜  在 python 代码示例中创建响应对象

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

代码示例1
from requests.models import Response

the_response = Response()
the_response.code = "expired"
the_response.error_type = "expired"
the_response.status_code = 400
the_response._content = b'{ "key" : "a" }'

print(the_response.json())