Created
January 31, 2013 14:35
-
-
Save nbargnesi/4683244 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
261,262c261,262 | |
< # Except the ``url``. Requests on Py3 *really* wants that to be a | |
< # string, not bytes. | |
--- | |
> # Except the ``url`` and ``headers``. Requests on Py3 *really* | |
> # wants those to be strings, not bytes. | |
264c264 | |
< bytes_headers = {} | |
--- | |
> _headers = {} | |
269c269 | |
< if headers is not None: | |
--- | |
> if headers is not None and not IS_PY3: | |
271c271,273 | |
< bytes_headers[force_bytes(k)] = force_bytes(v) | |
--- | |
> _headers[force_bytes(k)] = force_bytes(v) | |
> else: | |
> _headers = headers | |
273c275 | |
< resp = requests_method(url, data=bytes_body, headers=bytes_headers, files=files, | |
--- | |
> resp = requests_method(url, data=bytes_body, headers=_headers, files=files, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment