Skip to content
Myr

Merge pull request #729 from vickimo/issue_661

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

Added needed cast for when POSTing data and files (Issue #661)

authored by Kenneth Reitz · committed by Kenneth Reitz · parents e02fb2e, f9c0ddf · Browse files · 1 file+7 added−0 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−0 removed

  • other:+7 added−0 removed

1 file+7 added−0 removed

modified:requests/models.py+7 added
353 unmodified lines
354 if isinstance(fp, (bytes, str)):355 fp = StringIO(fp)356 fields.update({k: (fn, fp.read())})357358 for field in fields:359 if isinstance(fields[field], float):360 fields[field] = str(fields[field])361 if isinstance(fields[field], list):362 newvalue = ', '.join(fields[field])363 fields[field] = newvalue364 365 (body, content_type) = encode_multipart_formdata(fields)366367 return (body, content_type)368
475 unmodified lines