mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
fix issue #2844
This commit is contained in:
+1
-1
@@ -81,7 +81,7 @@ class RequestEncodingMixin(object):
|
||||
"""
|
||||
|
||||
if isinstance(data, (str, bytes)):
|
||||
return data
|
||||
return to_native_string(data)
|
||||
elif hasattr(data, 'read'):
|
||||
return data
|
||||
elif hasattr(data, '__iter__'):
|
||||
|
||||
@@ -139,6 +139,11 @@ class RequestsTestCase(unittest.TestCase):
|
||||
prep = session.prepare_request(request)
|
||||
assert prep.url == 'http://example.com/?z=1&a=1&k=1&d=1'
|
||||
|
||||
def test_params_bytes_are_encoded(self):
|
||||
request = requests.Request('GET', 'http://example.com',
|
||||
params=b'test=foo').prepare()
|
||||
assert request.url == 'http://example.com/?test=foo'
|
||||
|
||||
def test_mixed_case_scheme_acceptable(self):
|
||||
s = requests.Session()
|
||||
s.proxies = getproxies()
|
||||
|
||||
Reference in New Issue
Block a user