def __deserialize_requests_response(self, to_deserialize):
"""
Create and return a Response based on the contents of the given dictionary.
:param to_deserialize: The dictionary to create the Response from.
:return: A Response created by the contents of to_deserialize.
"""
to_return = Response()
to_return.status_code = to_deserialize["status_code"]
to_return.headers = CaseInsensitiveDict(to_deserialize["headers"])
to_return.encoding = to_deserialize["encoding"]
to_return._content = to_deserialize["content"]
to_return._content_consumed = True
to_return.reason = to_deserialize["reason"]
to_return.url = to_deserialize["url"]
to_return.request = self.decode(to_deserialize["request"])
return to_return
评论列表
文章目录