-------------
Requests automatically decompresses gzip-encoded responses, and does
-its best to decodes response content to unicode when possible.
-it's best to decodes response content to unicode when possible.
+its best to decode response content to unicode when possible.
You can get direct access to the raw response (and even the socket),
if needed as well.
Support
=======
-If you have a questions or issues about Requests, there are serveral options:
+If you have a questions or issues about Requests, there are several options:
Send a Tweet
------------
=======
If you'd like to stay up to date on the community and development of Requests,
-there are serveral options:
+there are several options:
GitHub
------
requests.api
~~~~~~~~~~~~
-This module impliments the Requests API.
+This module implements the Requests API.
:copyright: (c) 2011 by Kenneth Reitz.
:license: ISC, see LICENSE for more details.
"""
class RequestException(Exception):
- """There was an ambiguous exception that occured while handling your
+ """There was an ambiguous exception that occurred while handling your
request."""
class AuthenticationError(RequestException):
def dispatch_hook(key, hooks, hook_data):
- """Dipatches a hook dictionary on a given peice of data."""
+ """Dispatches a hook dictionary on a given piece of data."""
hooks = hooks or dict()
params=dict(), auth=None, cookiejar=None, timeout=None, redirect=False,
allow_redirects=False, proxies=None, hooks=None):
- #: Float describ the timeout of the request.
+ #: Float describes the timeout of the request.
# (Use socket.setdefaulttimeout() as fallback)
self.timeout = timeout
#: Request URL.
self.url = url
- #: Dictonary of HTTP Headers to attach to the :class:`Request <Request>`.
+ #: Dictionary of HTTP Headers to attach to the :class:`Request <Request>`.
self.headers = headers
#: Dictionary of files to multipart upload (``{filename: content}``).
resp = opener(req)
if settings.timeout_fallback:
- # restore gobal timeout
+ # restore global timeout
socket.setdefaulttimeout(old_timeout)
if self.cookiejar is not None:
#: Final URL location of Response.
self.url = None
- #: True if no :attr:`error` occured.
+ #: True if no :attr:`error` occurred.
self.ok = False
- #: Resulting :class:`HTTPError` of request, if one occured.
+ #: Resulting :class:`HTTPError` of request, if one occurred.
self.error = None
#: A list of :class:`Response <Response>` objects from
def raise_for_status(self):
- """Raises stored :class:`HTTPError` or :class:`URLError`, if one occured."""
+ """Raises stored :class:`HTTPError` or :class:`URLError`, if one occurred."""
if self.error:
raise self.error
def session(**kwargs):
- """Returns a :class:`Session` for context-managment."""
+ """Returns a :class:`Session` for context-management."""
return Session(**kwargs)
\ No newline at end of file
412: ('precondition_failed', 'precondition'),
413: ('request_entity_too_large',),
414: ('request_uri_too_large',),
- 415: ('unspported_media_type', 'unspported_media', 'media_type'),
+ 415: ('unsupported_media_type', 'unsupported_media', 'media_type'),
416: ('requested_range_not_satisfiable', 'requested_range', 'range_not_satisfiable'),
417: ('expectation_failed',),
418: ('im_a_teapot', 'teapot', 'i_am_a_teapot'),
422: ('unprocessable_entity', 'unprocessable'),
423: ('locked',),
- 424: ('failed_depdendency', 'depdendency'),
+ 424: ('failed_dependency', 'dependency'),
425: ('unordered_collection', 'unordered'),
426: ('upgrade_required', 'upgrade'),
444: ('no_response', 'none'),
requests.structures
~~~~~~~~~~~~~~~~~~~
-Datastructures that power Requests.
+Data structures that power Requests.
"""
collector.append(', ')
- # Remove trailing seperators.
+ # Remove trailing separators.
if collector[-1] in (', ', '; '):
del collector[-1]
def get_unicode_from_response(r):
"""Returns the requested content back in unicode.
- :param r: Reponse object to get unicode content from.
+ :param r: Response object to get unicode content from.
Tried: