mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Cleaning up comment on JSON encoding to be more strictly relevant.
This commit is contained in:
+2
-3
@@ -420,9 +420,8 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin):
|
||||
length = None
|
||||
|
||||
if not data and json is not None:
|
||||
# When urllib3 uses pyOpenSSL, it can only resume large uploads
|
||||
# properly if receiving a bytes-like object. In Python 2, json.dumps()
|
||||
# returns just that, but Python 3 returns a Unicode string.
|
||||
# urllib3 requires a bytes-like body. Python 2's json.dumps
|
||||
# provides this natively, but Python 3 gives a Unicode string.
|
||||
content_type = 'application/json'
|
||||
body = complexjson.dumps(json)
|
||||
if not isinstance(body, bytes):
|
||||
|
||||
Reference in New Issue
Block a user