Merge pull request #1474 from Kwpolska/docfix
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Some tiny fixes to the documentation
authored by Kenneth Reitz · committed by Kenneth Reitz · parents 949a29c, 2ef782b · Browse files · 8 files·+24 added−23 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
8 files+24 added−23 removed
- other:+24 added−23 removed
Provenance
- Commit
d83919a- Tree
ec6dd61- Author
Kenneth Reitz <me@kennethreitz.com>- Committer
Kenneth Reitz <me@kennethreitz.com>- Parent 1
949a29c- Parent 2
2ef782b
8 files changed+24 added−23 removed
modified:docs/dev/philosophy.rst+1 added-1 removed
36 unmodified lines37 ~~~~~~~~~~~~~~~~~~~~~38 39 Distributions have been made for many Linux repositories, including: Ubuntu, Debian, RHEL, and Arch.40 41-These distributions are sometimes divergent forks, or are otherwise not kept up-to-date with the latest code and bugfixes. PyPI (and its mirrors) and GitHub are the official distribution sources; alternatives are not supported by the requests project.41+These distributions are sometimes divergent forks, or are otherwise not kept up-to-date with the latest code and bugfixes. PyPI (and its mirrors) and GitHub are the official distribution sources; alternatives are not supported by the Requests project.modified:docs/dev/todo.rst+2 added-2 removed
4 unmodified lines5 6 #. Check for open issues or open a fresh issue to start a discussion around a bug.7 There is a Contributor Friendly tag for issues that should be ideal for people who are not very8 familiar with the codebase yet.9-#. Fork `the repository <https://github.com/kennethreitz/requests>`_ on Github and start making your9+#. Fork `the repository <https://github.com/kennethreitz/requests>`_ on GitHub and start making your10 changes to a new branch.11 #. Write a test which shows that the bug was fixed.12 #. Send a pull request and bug the maintainer until it gets merged and published. :)13 Make sure to add yourself to `AUTHORS <https://github.com/kennethreitz/requests/blob/master/AUTHORS.rst>`_.31 unmodified lines45 - PyPy 1.946 47 Support for Python 3.1 and 3.2 may be dropped at any time.48 49-Google App Engine will never be officially supported. Pull requests for compatibility will be accepted, as long as they don't complicate the codebase.49+Google App Engine will never be officially supported. Pull Requests for compatibility will be accepted, as long as they don't complicate the codebase.50 51 52 Are you crazy?53 --------------7 unmodified linesmodified:docs/user/advanced.rst+4 added-4 removed
11 unmodified lines12 The Session object allows you to persist certain parameters across13 requests. It also persists cookies across all requests made from the14 Session instance.15 16-A session object has all the methods of the main Requests API.16+A Session object has all the methods of the main Requests API.17 18 Let's persist some cookies across requests::19 20 s = requests.Session()5 unmodified lines26 # '{"cookies": {"sessioncookie": "123456789"}}'27 28 29 Sessions can also be used to provide default data to the request methods. This30-is done by providing data to the properties on a session object::30+is done by providing data to the properties on a Session object::31 32 s = requests.Session()33 s.auth = ('user', 'pass')34 s.headers.update({'x-test': 'true'})15 unmodified lines50 51 Whenever a call is made to requests.*() you are doing two major things. First,52 you are constructing a ``Request`` object which will be sent off to a server53 to request or query some resource. Second, a ``Response`` object is generated54-once ``requests`` gets a response back from the server. The response object54+once ``requests`` gets a response back from the server. The Response object55 contains all of the information returned by the server and also contains the56 ``Request`` object you created originally. Here is a simple request to get some57 very important information from Wikipedia's servers::58 60 unmodified lines119 120 >>> requests.get('https://kennethreitz.com', verify=True)121 requests.exceptions.SSLError: hostname 'kennethreitz.com' doesn't match either of '*.herokuapp.com', 'herokuapp.com'122 123-I don't have SSL setup on this domain, so it fails. Excellent. Github does though::123+I don't have SSL setup on this domain, so it fails. Excellent. GitHub does though::124 125 >>> requests.get('https://github.com', verify=True)126 <Response [200]>127 467 unmodified linesmodified:docs/user/authentication.rst+1 added-1 removed
85 unmodified lines86 - Kerberos_87 - NTLM_88 89 If you want to use any of these forms of authentication, go straight to their90-Github page and follow the instructions.90+GitHub page and follow the instructions.91 92 93 New Forms of Authentication94 ---------------------------20 unmodified linesmodified:docs/user/install.rst+5 added-5 removed
8 unmodified lines9 10 Distribute & Pip11 ----------------12 13-Installing requests is simple with `pip <http://www.pip-installer.org/>`_::13+Installing Requests is simple with `pip <http://www.pip-installer.org/>`_::14 15 $ pip install requests16 17 or, with `easy_install <http://pypi.python.org/pypi/setuptools>`_::3 unmodified lines21 But, you really `shouldn't do that <http://www.pip-installer.org/en/latest/other-tools.html#pip-compared-to-easy-install>`_.22 23 24 25-Cheeseshop Mirror26------------------25+Cheeseshop (PyPI) Mirror26+------------------------27 28-If the Cheeseshop is down, you can also install Requests from one of the29-mirrors. `Crate.io <http://crate.io>`_ is one of them::28+If the Cheeseshop (a.k.a. PyPI) is down, you can also install Requests from one29+of the mirrors. `Crate.io <http://crate.io>`_ is one of them::30 31 $ pip install -i http://simple.crate.io/ requests32 33 23 unmodified linesmodified:docs/user/quickstart.rst+8 added-7 removed
115 unmodified lines116 117 The ``gzip`` and ``deflate`` transfer-encodings are automatically decoded for you.118 119 For example, to create an image from binary data returned by a request, you can120-use the following code:120+use the following code::121 122 >>> from PIL import Image123 >>> from StringIO import StringIO124 >>> i = Image.open(StringIO(r.content))47 unmodified lines172 More complicated POST requests173 ------------------------------174 175 Typically, you want to send some form-encoded data — much like an HTML form.176-To do this, simply pass a dictionary to the `data` argument. Your176+To do this, simply pass a dictionary to the ``data`` argument. Your177 dictionary of data will automatically be form-encoded when the request is made::178 179 >>> payload = {'key1': 'value1', 'key2': 'value2'}180 >>> r = requests.post("http://httpbin.org/post", data=payload)161 unmodified lines342 Requests will automatically perform location redirection while using the GET343 and OPTIONS verbs.344 345 GitHub redirects all HTTP requests to HTTPS. We can use the ``history`` method346-of the Response object to track redirection. Let's see what Github does::346+of the Response object to track redirection. Let's see what GitHub does::347 348 >>> r = requests.get('http://github.com')349 >>> r.url350 'https://github.com/'1 unmodified line352 200353 >>> r.history354 [<Response [301]>]355 356-The :class:`Response.history` list contains a list of the357-:class:`Request` objects that were created in order to complete the request. The list is sorted from the oldest to the most recent request.356+The :class:`Response.history` list contains the :class:`Request` objects that357+were created in order to complete the request. The list is sorted from the358+oldest to the most recent request.359 360 If you're using GET or OPTIONS, you can disable redirection handling with the361 ``allow_redirects`` parameter::362 15 unmodified lines378 379 Timeouts380 --------381 381-You can tell requests to stop waiting for a response after a given number of382+You can tell Requests to stop waiting for a response after a given number of383 seconds with the ``timeout`` parameter::384 385 >>> requests.get('http://github.com', timeout=0.001)386 Traceback (most recent call last):2 unmodified lines389 390 391 .. admonition:: Note:392 392- ``timeout`` only effects the connection process itself, not the393+ ``timeout`` only affects the connection process itself, not the394 downloading of the response body.395 396 397 Errors and Exceptions20 unmodified linesmodified:docs/api.rst+1 added-1 removed
184 unmodified lines185 ~~~~~~~~~186 187 One key difference that has nothing to do with the API is a change in the188 license from the ISC_ license to the `Apache 2.0`_ license. The Apache 2.0189-license ensures that contributions to requests are also covered by the Apache189+license ensures that contributions to Requests are also covered by the Apache190 2.0 license.191 192 .. _ISC: http://opensource.org/licenses/ISC193 .. _Apache 2.0: http://opensource.org/licenses/Apache-2.01 unmodified linemodified:README.rst+2 added-2 removed
57 unmodified lines58 59 Installation60 ------------61 62-To install requests, simply:62+To install Requests, simply:63 64 .. code-block:: bash65 66 $ pip install requests16 unmodified lines83 Contribute84 ----------85 86 #. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug. There is a Contributor Friendly tag for issues that should be ideal for people who are not very familiar with the codebase yet.87-#. Fork `the repository`_ on Github to start making your changes to the **master** branch (or branch off of it).87+#. Fork `the repository`_ on GitHub to start making your changes to the **master** branch (or branch off of it).88 #. Write a test which shows that the bug was fixed or that the feature works as expected.89 #. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to AUTHORS_.90 91 .. _`the repository`: http://github.com/kennethreitz/requests1 unmodified line