Codebase list python-pygerrit2 / 869c2fa
Add debug log of response content type, status code and encoding Change-Id: Ib262008728c6c884a5f8fb28f66fa7595d1254ef David Pursehouse 5 years ago
1 changed file(s) with 3 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
5353 requests.HTTPError if the response contains an HTTP error status code.
5454
5555 """
56 content_type = response.headers.get('content-type', '')
57 logger.debug("status[%s] content_type[%s] encoding[%s]" %
58 (response.status_code, content_type, response.encoding))
5659 content = response.content.strip()
5760 if response.encoding:
5861 content = content.decode(response.encoding)
5962 response.raise_for_status()
60 content_type = response.headers.get('content-type', '')
6163 if content_type.split(';')[0] != 'application/json':
6264 return content
6365 if content.startswith(GERRIT_MAGIC_JSON_PREFIX):