From: Kenneth Reitz Date: Thu, 10 Jan 2013 07:13:02 +0000 (-0500) Subject: v1.1.0 and docs X-Git-Tag: v1.1.0~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=41687c8fa8e77830a8ff3f2cefa05d8a586c5132;p=services%2Fpython-requests.git v1.1.0 and docs --- diff --git a/HISTORY.rst b/HISTORY.rst index 7586ed0..a3491a1 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,6 +3,15 @@ History ------- +1.1.0 (2013-01-10) +++++++++++++++++++ + +- CHUNKED REQUESTS +- Support for iterable response bodies +- Assume servers persist redirect params +- Allow explicit content types to be specified for file data +- Make merge_kwargs case-insensitive when looking up keys + 1.0.3 (2012-12-18) ++++++++++++++++++ diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst index 0bf3451..51cef7e 100644 --- a/docs/user/advanced.rst +++ b/docs/user/advanced.rst @@ -138,6 +138,28 @@ Excellent news — thanks to urllib3, keep-alive is 100% automatic within a ses Note that connections are only released back to the pool for reuse once all body data has been read; be sure to either set ``stream`` to ``False`` or read the ``content`` property of the ``Response`` object. +Streaming Uploads +----------------- + +Requests supports streaming uploads, which allow you to send large streams or files without reading them into memory. To stream and upload, simply provide a file-like object for your body:: + + with open('massive-body') as f: + request.post('http://some.url/streamed', data=f) + + +Chunk-Encoded Requests +---------------------- + +Requests also supports Chunked transfer encoding for outgoing and incoming requests. To send a chunk-encoded request, simply provide a generator (or any iterator without a length) for your body:: + + + def gen(): + yield 'hi' + yield 'there' + + request.post('http://some.url/chunked', data=gen()) + + Event Hooks ----------- diff --git a/requests/__init__.py b/requests/__init__.py index ef34a74..7ea7e62 100644 --- a/requests/__init__.py +++ b/requests/__init__.py @@ -36,17 +36,17 @@ usage: The other HTTP methods are supported - see `requests.api`. Full documentation is at . -:copyright: (c) 2012 by Kenneth Reitz. +:copyright: (c) 2013 by Kenneth Reitz. :license: Apache 2.0, see LICENSE for more details. """ __title__ = 'requests' -__version__ = '1.0.4' -__build__ = 0x01004 +__version__ = '1.1.0' +__build__ = 0x010100 __author__ = 'Kenneth Reitz' __license__ = 'Apache 2.0' -__copyright__ = 'Copyright 2012 Kenneth Reitz' +__copyright__ = 'Copyright 2013 Kenneth Reitz' from . import utils