kennethreitz/requests — pull request #288 by sharat87 (2011-11-25 03:18:59+00:00)
Title: Add use_session argument to request method.

This allows usage of an existing session to make a request with the request and the get, post etc. function.

I made this so that it is easier to create async requests with pre-existing sessions. Currently, we have to do

async.map([my_session.get(url, return_response=False, prefetch=True) for url in urls])

I got the `return_response` and `prefetch` arguments from inspecting the source of async module. This isn't very pleasant.

With the proposed simple change in this pull request, one can do

async.map([async.get(url, use_session=my_session) for url in urls])

which feels more natural.