Debugging 使用http.client调试时如何格式化输出?

Debugging 使用http.client调试时如何格式化输出?,debugging,python-3.x,Debugging,Python 3.x,这是我的代码: 编码=UTF-8 导入urllib3 导入http.client http.client.HTTPConnection.debuglevel=1 美国石油学会http://www.nyaa.eu/' http\u pool=urllib3.connection\u from\u urlAPI\u URL r=http\u池。请求'GET',API\u URL 打印r.状态 输出如下: send: b'GET http://www.nyaa.eu/ HTTP/1.1\r\nHost

这是我的代码:

编码=UTF-8 导入urllib3 导入http.client http.client.HTTPConnection.debuglevel=1 美国石油学会http://www.nyaa.eu/' http\u pool=urllib3.connection\u from\u urlAPI\u URL r=http\u池。请求'GET',API\u URL 打印r.状态 输出如下:

send: b'GET http://www.nyaa.eu/ HTTP/1.1\r\nHost: www.nyaa.eu\r\nAccept-Encoding: identity\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Server header: Date header: Content-Type header: Transfer-Encoding header: Connection header: Vary 200
输出不包含\n。 这很难阅读。 有没有办法格式化输出