Skip to content
Myr

Merge branch 'develop' into feature/rewrite

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

Conflicts: requests/__init__.py test_requests.py

authored by Kenneth Reitz · committed by Kenneth Reitz · parents f9141f5, f5bbb97 · Browse files · 13 files+94 added−12 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+94 added−12 removed

  • other:+94 added−12 removed

13 files+94 added−12 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+3 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.11- `daikon <https://github.com/neogenix/daikon>`_, a CLI for ElasticSearch.1213Articles & Talks14================15- `Python for the Web <http://gun.io/blog/python-for-the-web/>`_ teaches how to use Python to interact with the web, using Requests.
1 unmodified line
17- `My 'Python for Humans' talk <http://python-for-humans.heroku.com>`_ ( `audio <http://codeconf.s3.amazonaws.com/2011/pycodeconf/talks/PyCodeConf2011%20-%20Kenneth%20Reitz.m4a>`_ )18- `Issac Kelly's 'Consuming Web APIs' talk <http://issackelly.github.com/Consuming-Web-APIs-with-Python-Talk/slides/slides.html>`_19- `Blog post about Requests via Yum <http://arunsag.wordpress.com/2011/08/17/new-package-python-requests-http-for-humans/>`_20- `Russian blog post introducing Requests <http://habrahabr.ru/blogs/python/126262/>`_21- `French blog post introducing Requests <http://www.nicosphere.net/requests-urllib2-de-python-simplifie-2432/>`_222324Integrations25============
41 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:docs/index.rst+1 added-1 removed
37 unmodified lines
3839Testimonials40------------4142`Twitter, Inc <http://twitter.com>`_,42`The Washington Post <http://www.washingtonpost.com/>`_, `Twitter, Inc <http://twitter.com>`_,43a U.S. Federal Institution,44NIH, 45`Readability <http://readability.com>`_, and46`Work for Pie <http://workforpie.com>`_
72 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/auth.py+2 added-1 removed
65 unmodified lines
66 return None6768 # XXX not implemented yet69 entdig = None70 path = urlparse(r.request.url).path70 p_parsed = urlparse(r.request.url)71 path = p_parsed.path + p_parsed.query7273 A1 = "%s:%s:%s" % (username, realm, password)74 A2 = "%s:%s" % (r.request.method, path)75
71 unmodified lines
modified:requests/models.py+7 added-2 removed
91 unmodified lines
92 #: content and metadata of HTTP Response, once :attr:`sent <send>`.93 self.response = Response()9495 #: Authentication tuple to attach to :class:`Request <Request>`.96 self._auth = auth97 self.auth = auth_dispatch(auth)9899 #: CookieJar to attach to :class:`Request <Request>`.100 self.cookies = cookies
149 unmodified lines
250 files=self.files,251 method=method,252 # data=self.data,253 # params=self.params,253 auth=self.auth,254 auth=self._auth,255 cookies=self.cookies,256 redirect=True,257 config=self.config,258 _poolmanager=self._poolmanager
273 unmodified lines
532 raise RuntimeError('The content for this response was '533 'already consumed')534535 # Read the contents.536 try:535 self._content = self.raw.read()537 self._content = self.raw.read()538 except AttributeError:539 return None540541542 # Decode GZip'd content.543 if 'gzip' in self.headers.get('content-encoding', ''):544 try:545 self._content = decode_gzip(self._content)
27 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+11 added
1History2-------340.7.6 (2011-11-07)5++++++++++++++++++67* Digest authentication bugfix (attach query data to path)890.7.5 (2011-11-04)10++++++++++++++++++1112* Response.content = None if there was an invalid repsonse.13* Redirection auth handling.14150.7.4 (2011-10-26)16++++++++++++++++++1718* Sesion Hooks fix.
223 unmodified lines
modified:README.rst+4 added-2 removed
91 unmodified lines
9293Contribute94----------9596If you'd like to contribute, simply fork `the repository`_, commit your changes to the **develop** branch (or branch off of it), and send a pull request. Make sure you add yourself to AUTHORS_.96#. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug. There is a Contributor Friendly tag for issues that should be ideal for people who are not very familiar with the codebase yet.97#. Fork `the repository`_ on Github to start making your changes to the **develop** branch (or branch off of it).98#. Write a test which shows that the bug was fixed or that the feature works as expected.99#. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to AUTHORS_.10098101.. _`the repository`: http://github.com/kennethreitz/requests102.. _AUTHORS: http://github.com/kennethreitz/requests/blob/master/AUTHORS
modified:test_requests.py+9 added
546 unmodified lines
547 print r.history[0].cookies548 print r.content549 print r.url550551 def test_invalid_content(self):552553 # WARNING: if you're using a terrible DNS provider (comcast),554 # this will fail.555 r = requests.get('http://somedomainthatclearlydoesntexistg.com', allow_redirects=False)556557 assert r.content == None558559560561if __name__ == '__main__':562 unittest.main()