diff options
| author | Cory Benfield <lukasaoz@gmail.com> | 2016-04-07 09:38:44 +0100 |
|---|---|---|
| committer | Cory Benfield <lukasaoz@gmail.com> | 2016-04-07 09:38:44 +0100 |
| commit | db38b9de614c0796dbbf99a546535ecf7098a437 (patch) | |
| tree | 8b598c833032e4ae89a1ecb0a5e362fe59c17b9e /docs | |
| parent | a50b6d8a390ab042425d7e8a95edc13bea533d84 (diff) | |
| parent | 055cc44c076f29cf9e0cee8da6641bc0cebf1ec8 (diff) | |
| download | urllib3-db38b9de614c0796dbbf99a546535ecf7098a437.tar.gz | |
Merge branch 'patch-1' of https://github.com/alecz20/urllib3 into alecz20-patch-1
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/index.rst | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/index.rst b/docs/index.rst index 1188b5ad..c1882022 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -101,6 +101,18 @@ like buffering: >>> secondpart = b.read() +The response can be treated as a file-like object. +A file can be downloaded directly to a local file in a context without +being saved in memory. + +.. doctest :: + + >>> url = 'http://example.com/file' + >>> http = urllib3.PoolManager() + >>> with http.request('GET', url, preload_content=False) as r, open('filename', 'wb') as fp: + >>> .... shutil.copyfileobj(r, fp) + + Upgrading & Versioning ---------------------- |
