mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Merge commit '4aa4f82b37aeb272637fafeff498014af1c11c6b' into v3.0.0
This commit is contained in:
@@ -216,9 +216,6 @@ class Request(RequestHooksMixin):
|
||||
params = {} if params is None else params
|
||||
hooks = {} if hooks is None else hooks
|
||||
|
||||
# Default empty string for method.
|
||||
method = '' if method is None else method
|
||||
|
||||
self.hooks = default_hooks()
|
||||
for (k, v) in list(hooks.items()):
|
||||
self.register_hook(event=k, hook=v)
|
||||
|
||||
+3
-2
@@ -110,7 +110,7 @@ class TestRequests(object):
|
||||
requests.get('http://')
|
||||
|
||||
def test_basic_building(self):
|
||||
req = requests.Request()
|
||||
req = requests.Request(method='GET')
|
||||
req.url = 'http://kennethreitz.org/'
|
||||
req.data = {'life': '42'}
|
||||
|
||||
@@ -166,7 +166,8 @@ class TestRequests(object):
|
||||
s = requests.Session()
|
||||
s.proxies = getproxies()
|
||||
parts = urlparse(httpbin('get'))
|
||||
schemes = ['http://', 'HTTP://', 'hTTp://', 'HttP://']
|
||||
schemes = ['http://', 'HTTP://', 'hTTp://', 'HttP://',
|
||||
'https://', 'HTTPS://', 'hTTps://', 'HttPs://']
|
||||
for scheme in schemes:
|
||||
url = scheme + parts.netloc + parts.path
|
||||
r = requests.Request('GET', url)
|
||||
|
||||
Reference in New Issue
Block a user