Skip to content
Myr

added multipart_file syntax

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

authored by Kenneth Reitz · committed by Kenneth Reitz · parent df419fa · Browse files · 1 file+4 added−2 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+4 added−2 removed

  • other:+4 added−2 removed

1 file+4 added−2 removed

modified:requests/core.py+4 added-2 removed
281 unmodified lines
282 283 return r.response284285286def post(url, data={}, headers={}, auth=None):286def post(url, data={}, headers={}, multipart_files={}, auth=None):287 """Sends a POST request. Returns :class:`Response` object.288289 :param url: URL for the new :class:`Request` object.290 :param data: (optional) Dictionary of POST Data to send with the :class:`Request`.291 :param headers: (optional) Dictionary of HTTP Headers to sent with the :class:`Request`.292 :param multipart_files: (optional) Dictoinary of 'filename': file-like-objects for multipart encoding upload.293 :param auth: (optional) AuthObject to enable Basic HTTP Auth.294 """295 296 r = Request()
9 unmodified lines
306 307 return r.response308 309 309def put(url, data='', headers={}, auth=None):310def put(url, data='', headers={}, multipart_files={}, auth=None):311 """Sends a PUT request. Returns :class:`Response` object.312313 :param url: URL for the new :class:`Request` object.314 :param data: (optional) Bytes of PUT Data to send with the :class:`Request`.315 :param headers: (optional) Dictionary of HTTP Headers to sent with the :class:`Request`.316 :param multipart_files: (optional) Dictoinary of 'filename': file-like-objects for multipart encoding upload.317 :param auth: (optional) AuthObject to enable Basic HTTP Auth.318 """319 320 r = Request()
85 unmodified lines