Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > debuglevel for a HTTP request

Reply
Thread Tools

debuglevel for a HTTP request

 
 
Carbon Man
Guest
Posts: n/a
 
      03-24-2009
#Python 2.5
# from Dive Into Python 11.5

import httplib
httplib.HTTPConnection.debuglevel = 1
import urllib2
request = urllib2.Request('http://localhost/test/atom.xml')
opener = urllib2.build_opener()
feeddata = opener.open(request).read()

It doesn't show the debug output, any ideas?


 
Reply With Quote
 
 
 
 
cgoldberg
Guest
Posts: n/a
 
      03-24-2009
> It doesn't show the debug output, any ideas?

I think like this:
opener = urllib2.build_opener(urllib2.HTTPHandler(debugleve l=1))

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Abort an HTTP request before the request timed out Gelonida N Python 0 02-27-2012 02:22 AM
urllib2.Request:: http Request sending successfully, but Responsecontains in valid data. nRk Python 1 02-12-2009 12:53 AM
Why getInputStream in a http servlet request isn't getting the datasent by browser HTTP POST action? James Java 3 11-25-2005 11:17 PM
How to enter to .aspx page by http connection using http POST request farazkazmi@gmail.com Java 6 08-29-2005 02:58 PM
Re: Accessing Request.InputStream / Request.BinaryRead *as the request is occuring*: How??? Brian Birtle ASP .Net 2 10-16-2003 02:11 PM



Advertisments