Skip to content
Myr

Merge pull request #797 from sigmavirus24/fix_order

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

Fix order of data+params

authored by Kenneth Reitz · committed by Kenneth Reitz · parents 2e71497, 6d418d9 · Browse files · 1 file+7 added−6 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+7 added−6 removed

  • other:+7 added−6 removed

1 file+7 added−6 removed

modified:requests/models.py+7 added-6 removed
350 unmodified lines
351 new_fields = []352 fields = to_key_val_list(self.data)353 files = to_key_val_list(files)354355 for field, val in fields:356 if isinstance(val, list):357 for v in val:358 new_fields.append((field, str(v)))359 else:360 new_fields.append((field, str(val)))361362 for (k, v) in files:363 # support for explicit filename364 if isinstance(v, (tuple, list)):365 fn, fp = v
5 unmodified lines
371 if isinstance(fp, bytes):372 fp = BytesIO(fp)373 new_fields.append((k, (fn, fp.read())))374368 for field, val in fields:369 if isinstance(val, list):370 for v in val:371 new_fields.append((k, str(v)))372 else:373 new_fields.append((field, str(val)))375 body, content_type = encode_multipart_formdata(new_fields)376377 return body, content_type378
488 unmodified lines