Skip to content
Myr

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

10 files+17 added−17 removed

modified:docs/_themes/README.rst+1 added-1 removed
1krTheme Sphinx Style2====================34This repository contains sphinx styles Kenneth Reitz uses in most of 5his projects. It is a drivative of Mitsuhiko's themes for Flask and Flask related5his projects. It is a derivative of Mitsuhiko's themes for Flask and Flask related6projects. To use this style in your Sphinx documentation, follow7this guide:891. put this folder as _themes into your docs folder. Alternatively
16 unmodified lines
modified:docs/user/advanced.rst+5 added-5 removed
8 unmodified lines
9Session Objects10---------------1112The Session object allows you to persist certain parameters across13requests. It also perstists cookies across all requests made from the13requests. It also persists cookies across all requests made from the14Session instance.1516A session object has all the methods of the main Requests API.17
30 unmodified lines
4849Body Content Workflow50----------------------5152By 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.52By 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.5354Let's walk through it::5556 tarball_url = 'https://github.com/kennethreitz/requests/tarball/master'
33 unmodified lines
9091Asynchronous Requests92----------------------9394Requests has first-class support for concurrent requests, powered95by gevent. This allows you to send a bunch of HTTP requests at the same94Requests has first-class support for concurrent requests, powered by gevent.95This allows you to send a bunch of HTTP requests at the same time.9697First, 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 lines
230 """Attaches HTTP Pizza Authentication to the given Request object."""231 def __init__(self, username):232 # setup any auth-related data here233 self.username = username234 234235 def __call__(self, r):236 # modify and return the request237 r.headers['X-Pizza'] = self.username238 return r
19 unmodified lines
modified:docs/user/quickstart.rst+1 added-1 removed
298 unmodified lines
299300Redirection and History301-----------------------302303Requests will automatically perform location redirection while using impodotent methods.303Requests will automatically perform location redirection while using idempotent methods.304305GitHub redirects all HTTP requests to HTTPS. Let's see what happens::306307 >>> r = requests.get('http://github.com')
62 unmodified lines
modified:docs/index.rst+1 added-1 removed
36 unmodified lines
37`The Washington Post <http://www.washingtonpost.com/>`_,38`Twitter, Inc <http://twitter.com>`_,39`Readability <http://readability.com>`_, and40Federal US Institutions41use Requests internally. It has been installed over 45,000 times from PyPi.41use Requests internally. It has been installed over 45,000 times from PyPI.4243**Armin Ronacher**44 Requests is the perfect example how beautiful an API can be with the45 right level of abstraction.
86 unmodified lines
modified:requests/api.py+1 added-1 removed
37 unmodified lines
38 :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 lines
modified:requests/defaults.py+1 added-1 removed
9 unmodified lines
1011: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 lines
modified:requests/exceptions.py+2 added-2 removed
11 unmodified lines
12 """There was an ambiguous exception that occurred while handling your13 request."""1415class HTTPError(RequestException):16 """An HTTP error occured."""16 """An HTTP error occurred."""1718class ConnectionError(RequestException):19 """A Connection error occured."""19 """A Connection error occurred."""2021class Timeout(RequestException):22 """The request timed out."""23
5 unmodified lines
modified:requests/models.py+2 added-2 removed
149 unmodified lines
150 response.config = self.config151152 if resp:153154 # 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)156157 # Make headers case-insensitive.158 response.headers = CaseInsensitiveDict(getattr(resp, 'headers', None))
11 unmodified lines
170171 # Save cookies in Response.172 response.cookies = cookies173174 # Save original resopnse for later.174 # Save original response for later.175 response.raw = resp176177 if is_error:178 response.error = resp
458 unmodified lines
modified:requests/sessions.py+1 added-1 removed
121 unmodified lines
122 :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 lines
modified:requests/utils.py+2 added-2 removed
2 unmodified lines
3"""4requests.utils5~~~~~~~~~~~~~~67This module provides utlity functions that are used within Requests7This module provides utility functions that are used within Requests8that are also useful for external consumption.910"""11
361 unmodified lines
373def requote_path(path):374 """Re-quote the given URL path component.375376 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)