Skip to content
Myr

Merge branch 'master' into develop

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

authored by Kenneth Reitz · committed by Kenneth Reitz · parents 5568f77, c052029 · Browse files · 13 files+20 added−19 removed
This commit

State

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

Diff stats

13 files+20 added−19 removed

  • other:+20 added−19 removed

13 files+20 added−19 removed

modified:docs/community/faq.rst+1 added-2 removed
7 unmodified lines
8Encoded Data?9-------------1011Requests automatically decompresses gzip-encoded responses, and does12its best to decodes response content to unicode when possible.13it's best to decodes response content to unicode when possible.12its best to decode response content to unicode when possible.1314You can get direct access to the raw response (and even the socket),15if needed as well.16
67 unmodified lines
modified:docs/community/support.rst+1 added-1 removed
1 unmodified line
23Support4=======56If you have a questions or issues about Requests, there are serveral options:6If you have a questions or issues about Requests, there are several options:78Send a Tweet9------------10
27 unmodified lines
modified:docs/community/updates.rst+1 added-1 removed
2 unmodified lines
3Updates4=======56If you'd like to stay up to date on the community and development of Requests,7there are serveral options:7there are several options:89GitHub10------11
19 unmodified lines
modified:docs/index.rst+1 added
39 unmodified lines
40------------4142`Twitter, Inc <http://twitter.com>`_,43a U.S. Federal Institution,44NIH, 45`Readability <http://readability.com>`_, and46`Work for Pie <http://workforpie.com>`_47use Requests internally.48
70 unmodified lines
modified:requests/api.py+1 added-1 removed
2 unmodified lines
3"""4requests.api5~~~~~~~~~~~~67This module impliments the Requests API.7This module implements the Requests API.89:copyright: (c) 2011 by Kenneth Reitz.10:license: ISC, see LICENSE for more details.11
148 unmodified lines
modified:requests/exceptions.py+1 added-1 removed
5 unmodified lines
67"""89class RequestException(Exception):10 """There was an ambiguous exception that occured while handling your10 """There was an ambiguous exception that occurred while handling your11 request."""1213class AuthenticationError(RequestException):14 """The authentication credentials provided were invalid."""
12 unmodified lines
modified:requests/hooks.py+1 added-1 removed
24 unmodified lines
25import warnings262728def dispatch_hook(key, hooks, hook_data):29 """Dipatches a hook dictionary on a given peice of data."""29 """Dispatches a hook dictionary on a given piece of data."""3031 hooks = hooks or dict()3233 if key in hooks:
7 unmodified lines
modified:requests/models.py+6 added-6 removed
39 unmodified lines
40 url=None, headers=dict(), files=None, method=None, data=dict(),41 params=dict(), auth=None, cookiejar=None, timeout=None, redirect=False,42 allow_redirects=False, proxies=None, hooks=None):4344 #: Float describ the timeout of the request.44 #: Float describes the timeout of the request.45 # (Use socket.setdefaulttimeout() as fallback)46 self.timeout = timeout4748 #: Request URL.49 self.url = url5051 #: Dictonary of HTTP Headers to attach to the :class:`Request <Request>`.51 #: Dictionary of HTTP Headers to attach to the :class:`Request <Request>`.52 self.headers = headers5354 #: Dictionary of files to multipart upload (``{filename: content}``).55 self.files = files
304 unmodified lines
360361 resp = opener(req)362363 if settings.timeout_fallback:364 # restore gobal timeout364 # restore global timeout365 socket.setdefaulttimeout(old_timeout)366367 if self.cookiejar is not None:368 self.cookiejar.extract_cookies(resp, req)
42 unmodified lines
411412 #: Final URL location of Response.413 self.url = None414415 #: True if no :attr:`error` occured.415 #: True if no :attr:`error` occurred.416 self.ok = False417418 #: Resulting :class:`HTTPError` of request, if one occured.418 #: Resulting :class:`HTTPError` of request, if one occurred.419 self.error = None420421 #: A list of :class:`Response <Response>` objects from422 #: the history of the Request. Any redirect responses will end
73 unmodified lines
496 return self._content497498499 def raise_for_status(self):500 """Raises stored :class:`HTTPError` or :class:`URLError`, if one occured."""500 """Raises stored :class:`HTTPError` or :class:`URLError`, if one occurred."""501 if self.error:502 raise self.error503504
175 unmodified lines
modified:requests/sessions.py+1 added-1 removed
128 unmodified lines
129 api.__all__)130131132def session(**kwargs):133 """Returns a :class:`Session` for context-managment."""133 """Returns a :class:`Session` for context-management."""134135 return Session(**kwargs)
modified:requests/status_codes.py+2 added-2 removed
45 unmodified lines
46 411: ('length_required',),47 412: ('precondition_failed', 'precondition'),48 413: ('request_entity_too_large',),49 414: ('request_uri_too_large',),50 415: ('unspported_media_type', 'unspported_media', 'media_type'),50 415: ('unsupported_media_type', 'unsupported_media', 'media_type'),51 416: ('requested_range_not_satisfiable', 'requested_range', 'range_not_satisfiable'),52 417: ('expectation_failed',),53 418: ('im_a_teapot', 'teapot', 'i_am_a_teapot'),54 422: ('unprocessable_entity', 'unprocessable'),55 423: ('locked',),56 424: ('failed_depdendency', 'depdendency'),56 424: ('failed_dependency', 'dependency'),57 425: ('unordered_collection', 'unordered'),58 426: ('upgrade_required', 'upgrade'),59 444: ('no_response', 'none'),60 449: ('retry_with', 'retry'),
23 unmodified lines
modified:requests/structures.py+1 added-1 removed
2 unmodified lines
3"""4requests.structures5~~~~~~~~~~~~~~~~~~~67Datastructures that power Requests.7Data structures that power Requests.89"""1011class CaseInsensitiveDict(dict):
54 unmodified lines
modified:requests/utils.py+2 added-2 removed
53 unmodified lines
54 if not len(headers) == i+1:55 collector.append(', ')565758 # Remove trailing seperators.58 # Remove trailing separators.59 if collector[-1] in (', ', '; '):60 del collector[-1]6162 return ''.join(collector)
135 unmodified lines
198199def get_unicode_from_response(r):200 """Returns the requested content back in unicode.201202 :param r: Reponse object to get unicode content from.202 :param r: Response object to get unicode content from.203204 Tried:205206 1. charset from content-type
48 unmodified lines
modified:AUTHORS+1 added
42 unmodified lines
43- Alejandro Giacometti44- Rick Mak45- Johan Bergström46- Josselin Jacquard47- Travis N. Vaught