Debug log received response for GET/POST

This commit is contained in:
Jakub Warmuz
2015-06-22 22:05:27 +00:00
parent cd7c6d8220
commit e17bd684bb
+3 -1
View File
@@ -77,6 +77,9 @@ class Client(object): # pylint: disable=too-many-instance-attributes
:raises .ClientError: In case of other networking errors.
"""
logging.debug('Received response %s (headers: %s): %r',
response, response.headers, response.content)
response_ct = response.headers.get('Content-Type')
try:
# TODO: response.json() is called twice, once here, and
@@ -169,7 +172,6 @@ class Client(object): # pylint: disable=too-many-instance-attributes
response = requests.post(uri, data=data, **kwargs)
except requests.exceptions.RequestException as error:
raise errors.ClientError(error)
logging.debug('Received response %s: %r', response, response.text)
self._add_nonce(response)
self._check_response(response, content_type=content_type)