Python HTTP request

By Sergio Filho, ago, written in Python.
Download Paste or View RawExpand paste to full width of browser | Change Viewing Options
  1. import urllib2
  2. import base64
  4. req = urllib2.Request('')
  5. req.add_header('User-Agent', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)')
  6. #base64string = base64.encodestring('%s:%s' %('user', 'pass'))
  7. #print base64string
  8. #req.add_header("Authorization", "Basic %s" %base64string)
  9. lol = urllib2.urlopen(req)
  10. print

Here you can reply to the paste above

Make Private


Feeling clever? Set some advanced options.