Merge branch '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 3326030, cf36d8c · Browse files · 11 files·+80 added−11 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
11 files+80 added−11 removed
- other:+80 added−11 removed
Provenance
- Commit
d0b96f8- Tree
be17ed6- Author
Kenneth Reitz <me@kennethreitz.com>- Committer
Kenneth Reitz <me@kennethreitz.com>- Parent 1
3326030- Parent 2
cf36d8c
11 files changed+80 added−11 removed
modified:docs/_themes/kr/static/flasky.css_t+12 added-1 removed
391 unmodified lines392 div.sphinxsidebar {393 display: none;394 }395 396+ div.document {397+ width: 100%;398+399+ }400+401 div.documentwrapper {402 margin-left: 0;403 margin-top: 0;404 margin-right: 0;14 unmodified lines419 .document {420 width: auto;421 }422 423+ .footer {424+ width: auto;425+ }426+427 .bodywrapper {428 margin: 0;429 }430 431 .footer {432 width: auto;433 }434 435+ .github {436+ display: none;437+ }438 427-439 }440 441 442 /* scrollbars */38 unmodified linesmodified:docs/_themes/kr/static/small_flask.css+20 added
66 unmodified lines67686970717273747576777879808182838485868788899066 unmodified linesdiv.body { min-height: 0; padding: 0;}
.rtd_doc_footer { display: none;}
.document { width: auto;}
.footer { width: auto;}
.footer { width: auto;}
.github { display: none;}No newline at end of filemodified:docs/_themes/kr/layout.html+4 added-3 removed
1234556789101112131415151616171819202127 unmodified lines{%- extends "basic/layout.html" %}{%- block extrahead %} {{ super() }} {% if theme_touch_icon %} <link rel="apple-touch-icon" href="{{ pathto('_static/' ~ theme_touch_icon, 1) }}" /> <link rel="apple-touch-icon" href="{{ pathto('_static/' ~ theme_touch_icon, 1) }}" /> {% endif %} <link media="only screen and (max-device-width: 480px)" href="{{ pathto('_static/small_flask.css', 1) }}" type= "text/css" rel="stylesheet" /> <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">{% endblock %}{%- block relbar2 %}{% endblock %}{%- block footer %} <div class="footer"> © Copyright {{ copyright }}. </div> <a href="https://github.com/kennethreitz/requests"> <img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /> <a href="https://github.com/kennethreitz/requests" class="github"> <img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" class="github"/> </a> <script type="text/javascript">
var _gaq = _gaq || [];27 unmodified linesmodified:docs/community/out-there.rst+1 added
5 unmodified lines6 - `robotframework-requests <https://github.com/bulkan/robotframework-requests>`_, a Robot Framework API wrapper.7 - `fullerene <https://github.com/bitprophet/fullerene>`_, a Graphite Dashboard.8 - `urbanairship-python <https://github.com/benjaminws/urbanairship-python>`_, a fork of the Urban Airship API wrapper.9 - `WhitespaceBot <https://github.com/Gunio/WhitespaceBot/>`_, a project that automatically forks repos, strips trailing whitespace, and sends a pull request.10+- `python-rexster <https://github.com/CulturePlex/python-rexster>`_, Rexter client that provides a simple interface for graph databases.11 12 Articles & Talks13 ================14 - `Python for the Web <http://gun.io/blog/python-for-the-web/>`_ teaches how to use Python to interact with the web, using Requests.50 unmodified linesmodified:docs/user/quickstart.rst+1 added-1 removed
162 unmodified lines163 164 165 -----------------------166 167-Ready for more? Check out the advanced_ section.167+Ready for more? Check out the :ref:`advanced <advanced>` section.modified:requests/__init__.py+2 added-2 removed
13 unmodified lines14 15 """16 17 __title__ = 'requests'18-__version__ = '0.7.4'19-__build__ = 0x00070418+__version__ = '0.7.5'19+__build__ = 0x00070520 __author__ = 'Kenneth Reitz'21 __license__ = 'ISC'22 __copyright__ = 'Copyright 2011 Kenneth Reitz'23 10 unmodified linesmodified:requests/api.py+17 added
27 unmodified lines28 proxies=None,29 hooks=None,30 return_response=True,31 config=None):32+ """Constructs and sends a :class:`Request <Request>`.33+ Returns :class:`Response <Response>` object.34 35+ :param method: method for the new :class:`Request` object.36+ :param url: URL for the new :class:`Request` object.37+ :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`.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 'filename': file-like-objects for multipart encoding upload.42+ :param auth: (optional) Auth typle 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.47+ :param config: (optional) A configuration dictionary.48+ """49+50 s = session()51 return s.request(52 method, url, params, data, headers, cookies, files, auth,53 timeout, allow_redirects, proxies, hooks, return_response,68 unmodified linesmodified:requests/models.py+7 added-2 removed
94 unmodified lines95 #: content and metadata of HTTP Response, once :attr:`sent <send>`.96 self.response = Response()97 98 #: Authentication tuple to attach to :class:`Request <Request>`.99+ self._auth = auth100 self.auth = auth_dispatch(auth)101 102 #: CookieJar to attach to :class:`Request <Request>`.103 self.cookies = cookies133 unmodified lines237 files=self.files,238 method=method,239 # data=self.data,240 # params=self.params,240- auth=self.auth,241+ auth=self._auth,242 cookies=self.cookies,243 redirect=True,244 config=self.config245 )250 unmodified lines496 raise RuntimeError('The content for this response was '497 'already consumed')498 499 # Read the contents.500+ try:499- self._content = self.raw.read()501+ self._content = self.raw.read()502+ except AttributeError:503+ return None504 505+506 # Decode GZip'd content.507 if 'gzip' in self.headers.get('content-encoding', ''):508 try:509 self._content = decode_gzip(self._content)16 unmodified linesmodified:AUTHORS+3 added-1 removed
45 unmodified lines46 - Josselin Jacquard47 - Travis N. Vaught48 - Fredrik Möllerstrand49 - Daniel Hengeveld50-- Dan Head50+- Dan Head51+- Bruno Renié52+- David Fischermodified:HISTORY.rst+6 added
1 History2 -------3 4+0.7.5 (2001-11-04)5+++++++++++++++++++6+7+* Response.content = None if there was an invalid repsonse.8+* Redirection auth handling.9+10 0.7.4 (2011-10-26)11 ++++++++++++++++++12 13 * Sesion Hooks fix.223 unmodified linesmodified:test_requests.py+7 added-1 removed
8 unmodified lines9 import unittest10 11 import requests12 import envoy13+from urllib2 import HTTPError14 15 try:16 import omnijson as json17 except ImportError:221 unmodified lines239 240 241 def test_status_raising(self):242 r = requests.get(httpbin('status', '404'))242- self.assertRaises(requests.HTTPError, r.raise_for_status)243+ self.assertRaises(HTTPError, r.raise_for_status)244 245 r = requests.get(httpbin('status', '200'))246 self.assertFalse(r.error)247 r.raise_for_status()280 unmodified lines528 assert not params['a'] in r3.content529 assert params3['b'] in r3.content530 assert params3['c'] in r3.content531 532+ def test_invalid_content(self):533 534+ r = requests.get('http://somedomainthatclearlydoesntexistg.com')535+ assert r.content == None536+537+538 if __name__ == '__main__':539 unittest.main()