Skip to content
Myr

kill all the monkeys

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent 04ee583 · Browse files · 1 file+0 added−39 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+0 added−39 removed

  • other:+0 added−39 removed

1 file+0 added−39 removed

deleted:requests/monkeys.py-39 removed
1#-*- coding: utf-8 -*-23"""4requests.monkeys5~~~~~~~~~~~~~~~~67Urllib2 Monkey patches.89"""1011import urllib212import re1314class Request(urllib2.Request):15 """Hidden wrapper around the urllib2.Request object. Allows for manual16 setting of HTTP methods.17 """1819 def __init__(self, url, data=None, headers={}, origin_req_host=None, unverifiable=False, method=None):20 urllib2.Request.__init__(self, url, data, headers, origin_req_host, unverifiable)21 self.method = method2223 def get_method(self):24 if self.method:25 return self.method2627 return urllib2.Request.get_method(self)282930class HTTPRedirectHandler(urllib2.HTTPRedirectHandler):31 """HTTP Redirect handler."""32 def _pass(self, req, fp, code, msg, headers):33 pass3435 http_error_302 = _pass36 http_error_303 = _pass37 http_error_307 = _pass38 http_error_301 = _pass39