diff options
| author | Nate Prewitt <Nate.Prewitt@gmail.com> | 2016-11-21 14:17:28 -0700 |
|---|---|---|
| committer | Nate Prewitt <Nate.Prewitt@gmail.com> | 2016-11-21 14:17:28 -0700 |
| commit | 4f9d0e04552e7cfcc5bcc2a37cf9e548ca09ffd8 (patch) | |
| tree | 41dd66b27fdc2bd636a9aced02d80f79d6664a2f /docs | |
| parent | b9f1c448f7f9f44465b4ab8c57731e09ee5e1c97 (diff) | |
| download | python-requests-4f9d0e04552e7cfcc5bcc2a37cf9e548ca09ffd8.tar.gz | |
streaming doc clarification
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/user/quickstart.rst | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/docs/user/quickstart.rst b/docs/user/quickstart.rst index 4aa2bbf4..232760f4 100644 --- a/docs/user/quickstart.rst +++ b/docs/user/quickstart.rst @@ -178,13 +178,14 @@ In general, however, you should use a pattern like this to save what is being streamed to a file:: with open(filename, 'wb') as fd: - for chunk in r.iter_content(chunk_size): + for chunk in r.iter_content(chunk_size=128): fd.write(chunk) Using ``Response.iter_content`` will handle a lot of what you would otherwise have to handle when using ``Response.raw`` directly. When streaming a download, the above is the preferred and recommended way to retrieve the -content. Note that ``chunk_size`` is optional. +content. Note that ``chunk_size`` can be freely adjusted to a number that +may better fit your use cases. Custom Headers |
