From: Cory Benfield Date: Sat, 17 Nov 2012 10:57:26 +0000 (+0000) Subject: Update documentation on Sessions. X-Git-Tag: v1.0.0~106^2~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0792acc1305b42a8d3f3160f1e23fd4751ec9dc8;p=services%2Fpython-requests.git Update documentation on Sessions. This resolves issue #870. Better documentation here should be considered for further work. --- diff --git a/docs/api.rst b/docs/api.rst index 499ffd3..7914558 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -38,6 +38,9 @@ They all return an instance of the :class:`Response ` object. .. autofunction:: session +.. autoclass:: Session + :inherited-members: + Exceptions diff --git a/requests/sessions.py b/requests/sessions.py index f0d4f3c..0962d81 100644 --- a/requests/sessions.py +++ b/requests/sessions.py @@ -73,15 +73,42 @@ class Session(object): verify=True, cert=None): + #: A case-insensitive dictionary of headers to be sent on each + #: :class:`Request ` sent from this + #: :class:`Session `. self.headers = from_key_val_list(headers or []) + + #: Authentication tuple or object to attach to + #: :class:`Request `. self.auth = auth + + #: Float describing the timeout of the each :class:`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 `. 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 `. 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 `. 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()):