docs update
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 70faca2 · Browse files · 3 files·+47 added−19 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+47 added−19 removed
- other:+47 added−19 removed
Provenance
- Commit
3ddcc99- Tree
ae13bee- Author
Kenneth Reitz <me@kennethreitz.com>- Committer
Kenneth Reitz <me@kennethreitz.com>- Parent
70faca2
3 files changed+47 added−19 removed
modified:docs/api.rst+10 added-12 removed
16 unmodified lines17 They all return an instance of the :class:`Response <Response>` object.18 19 .. autofunction:: request20 21----------------------22-23-.. autoclass:: requests.Request24- :inherited-members:25-26-.. autoclass:: Response27- :inherited-members:28-29----------------------30-21 .. autofunction:: head22 .. autofunction:: get23 .. autofunction:: post24 .. autofunction:: put25 .. autofunction:: patch26 .. autofunction:: delete27 28 39------------------29+Lower-Level Classes30+~~~~~~~~~~~~~~~~~~~31 41-.. autofunction:: session32+.. autoclass:: requests.Request33+ :inherited-members:34 35+.. autoclass:: Response36+ :inherited-members:37+38+Sessions39+--------40+41 .. autoclass:: Session42 :inherited-members:43 44 87 unmodified linesmodified:requests/models.py+21 added-1 removed
155 unmodified lines156 :param params: dictionary of URL parameters to append to the URL.157 :param auth: Auth handler or (user, pass) tuple.158 :param cookies: dictionary or CookieJar of cookies to attach to this request.159 :param hooks: dictionary of callback hooks, for internal usage.160+161+ Usage::162+163+ >>> import requests164+ >>> req = requests.Request('GET', 'http://httpbin.org/get')165+ >>> req.prepare()166+ <PreparedRequest [GET]>167+168 """169 def __init__(self,170 method=None,171 url=None,49 unmodified lines221 class PreparedRequest(RequestEncodingMixin, RequestHooksMixin):222 """The fully mutable :class:`PreparedRequest <PreparedRequest>` object,223 containing the exact bytes that will be sent to the server.224 217- Generated from a :class:`Request <Request>` object or manually.225+ Generated from either a :class:`Request <Request>` object or manually.226+227+ Usage::228+229+ >>> import requests230+ >>> req = requests.Request('GET', 'http://httpbin.org/get')231+ >>> r = req.prepare()232+ <PreparedRequest [GET]>233+234+ >>> s = requests.Session()235+ >>> s.send(r)236+ <Response [200]>237+238 """239 240 def __init__(self):241 #: HTTP verb to send to the server.365 unmodified linesmodified:requests/sessions.py+16 added-6 removed
129 unmodified lines130 yield resp131 132 133 class Session(SessionRedirectMixin):134- """A Requests session."""134+ """A Requests session.135 136+ Provides cookie persistience, connection-pooling, and configuration.137+138+ Basic Usage::139+140+ >>> import requests141+ >>> s = requests.Session()142+ >>> s.get('http://httpbin.org/get')143+ 200144+ """145+146 def __init__(self):147 148 #: A case-insensitive dictionary of headers to be sent on each149 #: :class:`Request <Request>` sent from this150 #: :class:`Session <Session>`.151 self.headers = default_headers()152 143- #: Authentication tuple or object to attach to153+ #: Default Authentication tuple or object to attach to154 #: :class:`Request <Request>`.155 self.auth = None156 157 #: Dictionary mapping protocol to the URL of the proxy (e.g.8 unmodified lines166 #: :class:`Request <Request>`. The dictionary values may be lists for167 #: representing multivalued query parameters.168 self.params = {}169 160- #: Stream response content.170+ #: Stream response content default.171 self.stream = False172 163- #: SSL Verification.173+ #: SSL Verification default.174 self.verify = True175 166- #: SSL certificate.176+ #: SSL certificate default.177 self.cert = None178 179 #: Maximum number of redirects to follow.180 self.max_redirects = DEFAULT_REDIRECT_LIMIT181 172- #: Should we trust the environment182+ #: Should we trust the environment?183 self.trust_env = True184 185 # Set up a CookieJar to be used by default186 self.cookies = cookiejar_from_dict({})214 unmodified lines