Skip to content
Myr

better advanced quick start

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 53bf544 · Browse files · 1 file+8 added−2 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+8 added−2 removed

  • other:+8 added−2 removed

1 file+8 added−2 removed

modified:docs/user/advanced.rst+8 added-2 removed
44 unmodified lines
4546All values that are contained within a session are directly available to you:4748 Session attibutes:49 ``auth``, ``config``, ``cookies``, ``headers``, ``hooks``, ``keep_alive``, ``params``, ``proxies``, ''timeout``49 ``auth``, ``config``, ``cookies``, ``headers``, ``hooks``, ``keep_alive``, ``params``, ``proxies``, ``timeout``50515253Configuring Requests
16 unmodified lines
7071Asynchronous Requests72----------------------7374Requests has first-class support for non-blocking i/o requests, powered74Requests has first-class support for concurrent requests, powered75by gevent. This allows you to send a bunch of HTTP requests at the same7677First, let's import the async module. Heads up — if you don't have78`gevent <gevent>`_ this will fail::
22 unmodified lines
101102 >>> async.map(rs)103 [<Response [200]>, <Response [200]>, <Response [200]>, <Response [200]>]104105.. admonition:: Throttling106107 The ``map`` function also takes a ``size`` parameter, that specifies the nubmer of connections to make at a time::108109 async.map(rs, size=5)110111112Event Hooks113-----------114115Requests has a hook system that you can use to manipulate portions of
121 unmodified lines