Skip to content
Myr

big docs update on workflow of request lifecycle

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 3462d9c · Browse files · 1 file+21 added−0 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+21 added−0 removed

  • other:+21 added−0 removed

1 file+21 added−0 removed

modified:docs/user/advanced.rst+21 added
44 unmodified lines
4546All values that are contained within a session are directly available to you. See the :ref:`Session API Docs <sessionapi>` to learn more.474849Body Content Workflow50----------------------5152By default, When you make a request, the body of the response isn't downloaded immediately. The response headers are downloaded when you make a request, but the content isn't downloaded until you access the :class:`Response.content` attribute.5354Let's walk through it::5556 tarball_url = 'https://github.com/kennethreitz/requests/tarball/master'57 r = requests.get(tarball_url)5859The request has been made, but the connection is still open. The response body has not been downloaded yet. ::6061 r.content6263The content has been downloaded and cached.6465You can override this default behavior with the ``prefetch`` parameter::6667 r = requests.get(tarball_url, prefetch=True)68 # Blocks until all of request body has been downloaded.697071Configuring Requests72--------------------7374Sometimes you may want to configure a request to customize it's behavior. To do
180 unmodified lines