Skip to content
Myr

Merge pull request #2138 from dpursehouse/more-doc-updates

Before adoption: this commit came in with the history the project adopted, so no landing records it.

More doc updates

authored by Cory Benfield · committed by Cory Benfield · parents 999ba49, be453ba · Browse files · 4 files+14 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+14 added−7 removed

  • other:+14 added−7 removed

4 files+14 added−7 removed

deleted:docs/dev/internals.rst
modified:docs/user/authentication.rst+1 added-1 removed
97 unmodified lines
98If you can't find a good implementation of the form of authentication you99want, you can implement it yourself. Requests makes it easy to add your own100forms of authentication.101102To do so, subclass :class:`requests.auth.AuthBase` and implement the102To do so, subclass :class:`AuthBase <requests.auth.AuthBase>` and implement the103``__call__()`` method::104105 >>> import requests106 >>> class MyAuth(requests.auth.AuthBase):
22 unmodified lines
modified:docs/user/quickstart.rst+6 added-6 removed
4 unmodified lines
56.. module:: requests.models78Eager to get started? This page gives a good introduction in how to get started9with Requests. This assumes you already have Requests installed. If you do not,10head over to the :ref:`Installation <install>` section.9with Requests.1011First, make sure that:1213* Requests is :ref:`installed <install>`
16 unmodified lines
30timeline ::3132 >>> r = requests.get('https://github.com/timeline.json')3335Now, we have a :class:`Response` object called ``r``. We can get all the36information we need from this object.34Now, we have a :class:`Request <requests.Request>` object called ``r``. We can35get all the information we need from this object.3637Requests' simple API means that all forms of HTTP request are as obvious. For38example, this is how you make an HTTP POST request::39
244 unmodified lines
284285 >>> r.status_code == requests.codes.ok286 True287289If we made a bad request (a 4XX client error or 5XX server error response), we can raise it with290:class:`Response.raise_for_status()`::288If we made a bad request (a 4XX client error or 5XX server error response), we289can raise it with290:meth:`Response.raise_for_status() <requests.Response.raise_for_status>`::291292 >>> bad_r = requests.get('http://httpbin.org/status/404')293 >>> bad_r.status_code294 404
150 unmodified lines
modified:docs/api.rst+7 added
42 unmodified lines
4344.. autoclass:: requests.adapters.HTTPAdapter45 :inherited-members:4647Authentication48--------------4950.. autoclass:: requests.auth.AuthBase51.. autoclass:: requests.auth.HTTPBasicAuth52.. autoclass:: requests.auth.HTTPProxyAuth53.. autoclass:: requests.auth.HTTPDigestAuth5455Exceptions56~~~~~~~~~~5758.. autoexception:: requests.exceptions.RequestException
217 unmodified lines