mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
doctoring for Session
This commit is contained in:
@@ -13,8 +13,11 @@ import requests.api
|
||||
import cookielib
|
||||
|
||||
class Session(object):
|
||||
"""A Requests session."""
|
||||
|
||||
__attrs__ = ['headers', 'cookies', 'auth', 'timeout', 'proxies']
|
||||
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
|
||||
# Set up a CookieJar to be used by default
|
||||
@@ -27,9 +30,11 @@ class Session(object):
|
||||
# Map and wrap requests.api methods
|
||||
self._map_api_methods()
|
||||
|
||||
|
||||
def __repr__(self):
|
||||
return '<requests-client at 0x%x>' % (id(self))
|
||||
|
||||
|
||||
def _map_api_methods(self):
|
||||
"""Reads each available method from requests.api and decorates
|
||||
them with a wrapper, which inserts any instance-local attributes
|
||||
|
||||
Reference in New Issue
Block a user