From e6d5e5319ecba82021143624c1040d0ad01bce41 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 14 Feb 2011 09:01:09 -0500 Subject: [PATCH] added multipart_file syntax --- requests/core.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/requests/core.py b/requests/core.py index e22d73cf..9f94bbba 100644 --- a/requests/core.py +++ b/requests/core.py @@ -283,12 +283,13 @@ def head(url, params={}, headers={}, auth=None): return r.response -def post(url, data={}, headers={}, auth=None): +def post(url, data={}, headers={}, multipart_files={}, auth=None): """Sends a POST request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary of POST Data to send with the :class:`Request`. :param headers: (optional) Dictionary of HTTP Headers to sent with the :class:`Request`. + :param multipart_files: (optional) Dictoinary of 'filename': file-like-objects for multipart encoding upload. :param auth: (optional) AuthObject to enable Basic HTTP Auth. """ @@ -306,12 +307,13 @@ def post(url, data={}, headers={}, auth=None): return r.response -def put(url, data='', headers={}, auth=None): +def put(url, data='', headers={}, multipart_files={}, auth=None): """Sends a PUT request. Returns :class:`Response` object. :param url: URL for the new :class:`Request` object. :param data: (optional) Bytes of PUT Data to send with the :class:`Request`. :param headers: (optional) Dictionary of HTTP Headers to sent with the :class:`Request`. + :param multipart_files: (optional) Dictoinary of 'filename': file-like-objects for multipart encoding upload. :param auth: (optional) AuthObject to enable Basic HTTP Auth. """