Merge pull request #305 from oasisbob/develop
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Fix spelling errors, typos.
authored by Kenneth Reitz · committed by Kenneth Reitz · parents 961f78a, a6412b0 · Browse files · 10 files·+17 added−17 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
10 files+17 added−17 removed
- other:+17 added−17 removed
Provenance
- Commit
4e59f9e- Tree
86c28a4- Author
Kenneth Reitz <me@kennethreitz.com>- Committer
Kenneth Reitz <me@kennethreitz.com>- Parent 1
961f78a- Parent 2
a6412b0
10 files changed+17 added−17 removed
modified:docs/_themes/README.rst+1 added-1 removed
1 krTheme Sphinx Style2 ====================3 4 This repository contains sphinx styles Kenneth Reitz uses in most of 5-his projects. It is a drivative of Mitsuhiko's themes for Flask and Flask related5+his projects. It is a derivative of Mitsuhiko's themes for Flask and Flask related6 projects. To use this style in your Sphinx documentation, follow7 this guide:8 9 1. put this folder as _themes into your docs folder. Alternatively16 unmodified linesmodified:docs/user/advanced.rst+5 added-5 removed
8 unmodified lines9 Session Objects10 ---------------11 12 The Session object allows you to persist certain parameters across13-requests. It also perstists cookies across all requests made from the13+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.17 30 unmodified lines48 49 Body Content Workflow50 ----------------------51 52-By default, When you make a request, the body of the response isn't downloaded immediately. The response headers are downloaded when you make a request, but the content isn't downloaded until you access the :class:`Response.content` attribute.52+By default, when you make a request, the body of the response isn't downloaded immediately. The response headers are downloaded when you make a request, but the content isn't downloaded until you access the :class:`Response.content` attribute.53 54 Let's walk through it::55 56 tarball_url = 'https://github.com/kennethreitz/requests/tarball/master'33 unmodified lines90 91 Asynchronous Requests92 ----------------------93 94-Requests has first-class support for concurrent requests, powered95-by gevent. This allows you to send a bunch of HTTP requests at the same94+Requests has first-class support for concurrent requests, powered by gevent.95+This allows you to send a bunch of HTTP requests at the same time.96 97 First, let's import the async module. Heads up — if you don't have98 `gevent <http://pypi.python.org/pypi/gevent>`_ this will fail::99 130 unmodified lines230 """Attaches HTTP Pizza Authentication to the given Request object."""231 def __init__(self, username):232 # setup any auth-related data here233 self.username = username234- 234+235 def __call__(self, r):236 # modify and return the request237 r.headers['X-Pizza'] = self.username238 return r19 unmodified linesmodified:docs/user/quickstart.rst+1 added-1 removed
298 unmodified lines299 300 Redirection and History301 -----------------------302 303-Requests will automatically perform location redirection while using impodotent methods.303+Requests will automatically perform location redirection while using idempotent methods.304 305 GitHub redirects all HTTP requests to HTTPS. Let's see what happens::306 307 >>> r = requests.get('http://github.com')62 unmodified linesmodified:docs/index.rst+1 added-1 removed
36 unmodified lines37 `The Washington Post <http://www.washingtonpost.com/>`_,38 `Twitter, Inc <http://twitter.com>`_,39 `Readability <http://readability.com>`_, and40 Federal US Institutions41-use Requests internally. It has been installed over 45,000 times from PyPi.41+use Requests internally. It has been installed over 45,000 times from PyPI.42 43 **Armin Ronacher**44 Requests is the perfect example how beautiful an API can be with the45 right level of abstraction.86 unmodified linesmodified:requests/api.py+1 added-1 removed
37 unmodified lines38 :param data: (optional) Dictionary or bytes to send in the body of the :class:`Request`.39 :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`.40 :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`.41 :param files: (optional) Dictionary of 'name': file-like-objects (or {'name': ('filename', fileobj)}) for multipart encoding upload.42- :param auth: (optional) Auth typle to enable Basic/Digest/Custom HTTP Auth.42+ :param auth: (optional) Auth tuple to enable Basic/Digest/Custom HTTP Auth.43 :param timeout: (optional) Float describing the timeout of the request.44 :param allow_redirects: (optional) Boolean. Set to True if POST/PUT/DELETE redirect following is allowed.45 :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy.46 :param return_response: (optional) If False, an un-sent Request object will returned.99 unmodified linesmodified:requests/defaults.py+1 added-1 removed
9 unmodified lines10 11 :base_headers: Default HTTP headers.12 :verbose: Stream to write request logging to.13 :timeout: Seconds until request timeout.14-:max_redirects: Maximum njumber of redirects allowed within a request.14+:max_redirects: Maximum number of redirects allowed within a request.15 :decode_unicode: Decode unicode responses automatically?16 :keep_alive: Reuse HTTP Connections?17 :max_retries: The number of times a request should be retried in the event of a connection failure.18 :safe_mode: If true, Requests will catch all errors.24 unmodified linesmodified:requests/exceptions.py+2 added-2 removed
11 unmodified lines12 """There was an ambiguous exception that occurred while handling your13 request."""14 15 class HTTPError(RequestException):16- """An HTTP error occured."""16+ """An HTTP error occurred."""17 18 class ConnectionError(RequestException):19- """A Connection error occured."""19+ """A Connection error occurred."""20 21 class Timeout(RequestException):22 """The request timed out."""23 5 unmodified linesmodified:requests/models.py+2 added-2 removed
149 unmodified lines150 response.config = self.config151 152 if resp:153 154- # Fallback to None if there's no staus_code, for whatever reason.154+ # Fallback to None if there's no status_code, for whatever reason.155 response.status_code = getattr(resp, 'status', None)156 157 # Make headers case-insensitive.158 response.headers = CaseInsensitiveDict(getattr(resp, 'headers', None))11 unmodified lines170 171 # Save cookies in Response.172 response.cookies = cookies173 174- # Save original resopnse for later.174+ # Save original response for later.175 response.raw = resp176 177 if is_error:178 response.error = resp458 unmodified linesmodified:requests/sessions.py+1 added-1 removed
121 unmodified lines122 :param data: (optional) Dictionary or bytes to send in the body of the :class:`Request`.123 :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`.124 :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`.125 :param files: (optional) Dictionary of 'filename': file-like-objects for multipart encoding upload.126- :param auth: (optional) Auth typle to enable Basic/Digest/Custom HTTP Auth.126+ :param auth: (optional) Auth tuple to enable Basic/Digest/Custom HTTP Auth.127 :param timeout: (optional) Float describing the timeout of the request.128 :param allow_redirects: (optional) Boolean. Set to True if POST/PUT/DELETE redirect following is allowed.129 :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy.130 :param return_response: (optional) If False, an un-sent Request object will returned.149 unmodified linesmodified:requests/utils.py+2 added-2 removed
2 unmodified lines3 """4 requests.utils5 ~~~~~~~~~~~~~~6 7-This module provides utlity functions that are used within Requests7+This module provides utility functions that are used within Requests8 that are also useful for external consumption.9 10 """11 361 unmodified lines373 def requote_path(path):374 """Re-quote the given URL path component.375 376 This function passes the given path through an unquote/quote cycle to377- ensure that it is fully and consistenty quoted.377+ ensure that it is fully and consistently quoted.378 """379 parts = path.split("/")380 parts = (urllib.quote(urllib.unquote(part), safe="") for part in parts)381 return "/".join(parts)