Skip to content

Commit

Permalink
urlencode(data, True)
Browse files Browse the repository at this point in the history
  • Loading branch information
ifduyue committed Aug 5, 2023
1 parent 7dd7dec commit a74052d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions urlfetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ def make_connection(conn_type, host, port, timeout, source_address):
content_type, data = encode_multipart(data, files)
reqheaders["Content-Type"] = content_type
elif isinstance(data, dict):
data = urlencode(data, 1)
data = urlencode(data, True)

if isinstance(data, basestring) and not files:
# httplib will set 'Content-Length', also you can set it by yourself
Expand Down Expand Up @@ -1040,7 +1040,7 @@ def encode_multipart(data, files):
if isinstance(data, dict):
for name, values in data.items():
if not isinstance(values, (list, tuple, set)):
# behave like urllib.urlencode(dict, 1)
# behave like urllib.urlencode(dict, True)
values = (values,)
for value in values:
body.write(part_boundary)
Expand Down

0 comments on commit a74052d

Please sign in to comment.