1

これは私のコードです:

#coding=UTF-8
import urllib3
import http.client

http.client.HTTPConnection.debuglevel = 1

API_URL = 'http://www.nyaa.eu/'

http_pool = urllib3.connection_from_url(API_URL)
r = http_pool.request('GET',API_URL)
print (r.status)

次のような出力:

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。読みにくいです。出力をフォーマットする方法はありますか?

4

0 に答える 0