def _handle_response(self, resp, force_list=None):
"""Ensure response is successful and return body as XML."""
self._debuglog("Request executed: " + str(resp.status_code))
if resp.status_code != 200:
return None
if resp.headers["Content-Type"] != "text/xml":
# JSON requests not currently supported
return None
self._debuglog("Response Text: " + resp.text)
data = xmltodict.parse(resp.content, force_list=force_list)['QDocRoot']
auth_passed = data['authPassed']
if auth_passed is not None and len(auth_passed) == 1 and auth_passed == "0":
self._session_error = True
return None
return data
评论列表
文章目录