Update documentation on Sessions.
authorCory Benfield <lukasaoz@gmail.com>
Sat, 17 Nov 2012 10:57:26 +0000 (10:57 +0000)
committerCory Benfield <lukasaoz@gmail.com>
Sat, 17 Nov 2012 10:57:26 +0000 (10:57 +0000)
This resolves issue #870. Better documentation here should be considered
for further work.

docs/api.rst
requests/sessions.py

index 499ffd3c8abe8d363abf5352d476d705650a0ee2..791455812c44fdab0ec7db57fff4f591128b88f1 100644 (file)
@@ -38,6 +38,9 @@ They all return an instance of the :class:`Response <Response>` object.
 
 .. autofunction:: session
 
+.. autoclass:: Session
+   :inherited-members:
+
 
 
 Exceptions
index f0d4f3c7e873e6a475c929c0f8ce48e92e571585..0962d8191d158bbe7af0dda7544742aea15435be 100644 (file)
@@ -73,15 +73,42 @@ class Session(object):
         verify=True,
         cert=None):
 
+        #: A case-insensitive dictionary of headers to be sent on each
+        #: :class:`Request <Request>` sent from this
+        #: :class:`Session <Session>`.
         self.headers = from_key_val_list(headers or [])
+
+        #: Authentication tuple or object to attach to
+        #: :class:`Request <Request>`.
         self.auth = auth
+
+        #: Float describing the timeout of the each :class:`Request <Request>`.
         self.timeout = timeout
+
+        #: Dictionary mapping protocol to the URL of the proxy (e.g.
+        #: {'http': 'foo.bar:3128'}) to be used on each
+        #: :class:`Request <Request>`.
         self.proxies = from_key_val_list(proxies or [])
+
+        #: Event-handling hooks.
         self.hooks = from_key_val_list(hooks or {})
+
+        #: Dictionary of querystring data to attach to each
+        #: :class:`Request <Request>`. The dictionary values may be lists for
+        #: representing multivalued query parameters.
         self.params = from_key_val_list(params or [])
+
+        #: Dictionary of configuration parameters for this
+        #: :class:`Session <Session>`.
         self.config = from_key_val_list(config or {})
+
+        #: Prefetch response content.
         self.prefetch = prefetch
+
+        #: SSL Verification.
         self.verify = verify
+
+        #: SSL certificate.
         self.cert = cert
 
         for (k, v) in list(defaults.items()):