Skip to content
Myr

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

11 files+80 added−11 removed

modified:docs/_themes/kr/static/flasky.css_t+12 added-1 removed
391 unmodified lines
392 div.sphinxsidebar {393 display: none;394 }395396 div.document {397 width: 100%;398399 }400401 div.documentwrapper {402 margin-left: 0;403 margin-top: 0;404 margin-right: 0;
14 unmodified lines
419 .document {420 width: auto;421 }422423 .footer {424 width: auto;425 }426427 .bodywrapper {428 margin: 0;429 }430431 .footer {432 width: auto;433 }434435 .github {436 display: none;437 }438427439}440441442/* scrollbars */
38 unmodified lines
modified:docs/_themes/kr/static/small_flask.css+20 added
modified:docs/_themes/kr/layout.html+4 added-3 removed
modified:docs/community/out-there.rst+1 added
5 unmodified lines
6- `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.1112Articles & 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 lines
modified:docs/user/quickstart.rst+1 added-1 removed
162 unmodified lines
163164165-----------------------166167Ready for more? Check out the advanced_ section.167Ready for more? Check out the :ref:`advanced <advanced>` section.
modified:requests/__init__.py+2 added-2 removed
13 unmodified lines
1415"""1617__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 lines
modified:requests/api.py+17 added
27 unmodified lines
28 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.3435 :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 """4950 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 lines
modified:requests/models.py+7 added-2 removed
94 unmodified lines
95 #: content and metadata of HTTP Response, once :attr:`sent <send>`.96 self.response = Response()9798 #: Authentication tuple to attach to :class:`Request <Request>`.99 self._auth = auth100 self.auth = auth_dispatch(auth)101102 #: CookieJar to attach to :class:`Request <Request>`.103 self.cookies = cookies
133 unmodified lines
237 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 lines
496 raise RuntimeError('The content for this response was '497 'already consumed')498499 # Read the contents.500 try:499 self._content = self.raw.read()501 self._content = self.raw.read()502 except AttributeError:503 return None504505506 # Decode GZip'd content.507 if 'gzip' in self.headers.get('content-encoding', ''):508 try:509 self._content = decode_gzip(self._content)
16 unmodified lines
modified:AUTHORS+3 added-1 removed
45 unmodified lines
46- Josselin Jacquard47- Travis N. Vaught48- Fredrik Möllerstrand49- Daniel Hengeveld50- Dan Head50- Dan Head51- Bruno Renié52- David Fischer
modified:HISTORY.rst+6 added
1History2-------340.7.5 (2001-11-04)5++++++++++++++++++67* Response.content = None if there was an invalid repsonse.8* Redirection auth handling.9100.7.4 (2011-10-26)11++++++++++++++++++1213* Sesion Hooks fix.
223 unmodified lines
modified:test_requests.py+7 added-1 removed
8 unmodified lines
9import unittest1011import requests12import envoy13from urllib2 import HTTPError1415try:16 import omnijson as json17except ImportError:
221 unmodified lines
239240241 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)244245 r = requests.get(httpbin('status', '200'))246 self.assertFalse(r.error)247 r.raise_for_status()
280 unmodified lines
528 assert not params['a'] in r3.content529 assert params3['b'] in r3.content530 assert params3['c'] in r3.content531532 def test_invalid_content(self):533534 r = requests.get('http://somedomainthatclearlydoesntexistg.com')535 assert r.content == None536537538if __name__ == '__main__':539 unittest.main()