Skip to content
Myr

Cleaning up comment on JSON encoding to be more strictly relevant.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Jesse Shapiro · committed by Jesse Shapiro · parent 9ff2e43 · Browse files · 1 file+2 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−3 removed

  • other:+2 added−3 removed

1 file+2 added−3 removed

modified:requests/models.py+2 added-3 removed
418 unmodified lines
419 content_type = None420 length = None421422 if not data and json is not None:423 # When urllib3 uses pyOpenSSL, it can only resume large uploads424 # properly if receiving a bytes-like object. In Python 2, json.dumps()425 # returns just that, but Python 3 returns a Unicode string.423 # urllib3 requires a bytes-like body. Python 2's json.dumps424 # provides this natively, but Python 3 gives a Unicode string.425 content_type = 'application/json'426 body = complexjson.dumps(json)427 if not isinstance(body, bytes):428 body = body.encode('utf-8')
431 unmodified lines