- David Bonner <dbonner@gmail.com> @rascalking
- Vinod Chandru
- Johnny Goodnow <j.goodnow29@gmail.com>
+- Denis Ryzhkov <denisr@denisr.com>
"""Prepares the given HTTP headers."""
if headers:
+ if is_py2:
+ headers = dict((builtin_str(name), value) for name, value in headers.items())
self.headers = CaseInsensitiveDict(headers)
else:
self.headers = CaseInsensitiveDict()
import requests
from requests.auth import HTTPDigestAuth
-from requests.compat import str
+from requests.compat import is_py2, str
try:
import StringIO
requests.get(url, params={'foo': 'foo'})
requests.get(httpbin('ΓΈ'), params={'foo': 'foo'})
+ def test_unicode_header_name(self):
+ if is_py2:
+ requests.put(httpbin('put'), headers={unicode('Content-Type'): 'application/octet-stream'}, data='\xff')
+
def test_urlencoded_get_query_multivalued_param(self):
r = requests.get(httpbin('get'), params=dict(test=['foo', 'baz']))