getting http debug info
<p>I'm going through Dive into Python3.  When I get to the chapter on http web services section 14.4, I can't seem to duplicate the following output in the python3 shell.  Here's what the sample code looks like:</p>

<pre><code>from http.client import HTTPConnection
HTTPConnection.debuglevel = 1
from urllib.request import urlopen
response = urlopen('http://diveintopython3.org/examples/feed.xml')

send: b'GET /examples/feed.xml HTTP/1.1
Host: diveintopython3.org
Accept-Encoding: identity
User-Agent: Python-urllib/3.1'
Connection: close
reply: 'HTTP/1.1 200 OK'
â¦further debugging information omittedâ¦
</code></pre>

<p>When I enter this in ipython3, the final command gives no output.  So why am I not getting the debug info in the example?  After entering the above code, response.debuglevel == 0.  I'm using python3.5.2.</p>

<p>The final command should not give any output, what you probably want is:</p>

<pre><code>print(response.read())
</code></pre>

<p>Further, as I wrote in the comments above:
urllib got deprecated in Python3, you should use urllib2, see: docs.python.org/2/library/urllib.html </p>

python python-3.x urllib http.client