Skip to content
Myr

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

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

Co-Authored By: Timnit Gebru <tgebru@gmail.com> Co-Authored By: Sarah Gonzalez <smar.gonz@gmail.com> Co-Authored By: Leila Muhtasib <muhtasib@gmail.com>

authored by Victoria Mo · committed by Victoria Mo · parent a97a513 · 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