SHARE
TWEET

Untitled

Krenair Apr 1st, 2012 266 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class MyHTTPRedirectHandler(urllib2.HTTPRedirectHandler):
  2.     def redirect_request(self, req, fp, code, msg, headers, newurl):
  3.         request = urllib2.Request(newurl)
  4.         request.get_method = lambda: req.get_method()
  5.         return request
RAW Paste Data
Want to get better at Python?
Learn to code Python in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top