Skip to content
Myr

Merge branch 'master' into master

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

authored by Ian Stapleton Cordasco · committed by GitHub · parents 85ec7d7, 80e2637 · Browse files · 19 files+209 added−38 removed
This commit

State

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

Diff stats

19 files+209 added−38 removed

  • other:+209 added−38 removed

19 files+209 added−38 removed

added:.github/ISSUE_TEMPLATE/Bug_report.md+34 added
added:.github/ISSUE_TEMPLATE/Custom.md+7 added
added:.github/ISSUE_TEMPLATE/Feature_request.md+7 added
modified:docs/_static/custom.css+8 added
modified:docs/_templates/hacks.html+3 added-4 removed
modified:docs/_templates/sidebarintro.html+4 added-3 removed
11 unmodified lines
12<p>13 Requests is an elegant and simple HTTP library for Python, built for14 human beings.15</p>16<p>Sponsored by <strong><a href="https://linode.com/">Linode</a></strong> and <a href="http://docs.python-requests.org/en/master/community/sponsors/#patron-sponsors">other wonderful organizations</a>.</p>171819<script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=pythonrequestsorg" id="_carbonads_js"></script>2019<h3><a href="http://www.unixstickers.com/stickers/coding_stickers/requests-shaped-sticker">Stickers!</a></h3>21<p><a href="http://www.unixstickers.com/stickers/coding_stickers/requests-shaped-sticker">Requests Stickers!</a></p>22<h3>Stay Informed</h3>23<p>Receive updates on new releases and upcoming projects.</p>2425<p><iframe src="https://ghbtns.com/github-btn.html?user=kennethreitz&type=follow&count=false"26 allowtransparency="true" frameborder="0" scrolling="0" width="200" height="20"></iframe></p>2728<p><a href="https://twitter.com/kennethreitz" class="twitter-follow-button" data-show-count="false">Follow @kennethreitz</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script></p>27<p><a href="https://saythanks.io/to/kennethreitz">Say Thanks!</a></p>29<p><a href="http://tinyletter.com/kennethreitz">Join Mailing List</a>.</p>30<h3>Other Projects</h3>3132<p>More <a href="http://kennethreitz.org/">Kenneth Reitz</a> projects:</p>
17 unmodified lines
5051 <p></p>5253 <li><a href="https://github.com/requests/requests">Requests @ GitHub</a></li>53 <li><a href="https://pypi.python.org/pypi/requests">Requests @ PyPI</a></li>54 <li><a href="https://pypi.org/project/requests/">Requests @ PyPI</a></li>55 <li><a href="https://github.com/requests/requests/issues">Issue Tracker</a></li>56 <li><a href="http://docs.python-requests.org/en/latest/community/updates/#software-updates">Release History</a></li>57</ul>58
13 unmodified lines
modified:docs/_templates/sidebarlogo.html+6 added-3 removed
6 unmodified lines
7<iframe src="https://ghbtns.com/github-btn.html?user=requests&repo=requests&type=watch&count=true&size=large"8 allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px"></iframe>9</p>101112<p>13 Requests is an elegant and simple HTTP library for Python, built for14 human beings. You are currently looking at the documentation of the15 development release.16</p>16<h3><a href="http://www.unixstickers.com/stickers/coding_stickers/requests-shaped-sticker">Stickers!</a></h3>1718<p>Sponsored by <strong><a href="https://linode.com/">Linode</a></strong> and <a href="http://docs.python-requests.org/en/master/community/sponsors/#patron-sponsors">other wonderful organizations</a>.</p>1920<h3>Stay Informed</h3>21<p>Receive updates on new releases and upcoming projects.</p>2223<p><a href="http://www.unixstickers.com/stickers/coding_stickers/requests-shaped-sticker">Requests Stickers!</a></p>2425<p><a href="http://tinyletter.com/kennethreitz">Join Mailing List</a>.</p>2627<hr/>2829<script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=pythonrequestsorg" id="_carbonads_js"></script>3026<p>If you enjoy using this project, <a href="https://saythanks.io/to/kennethreitz">Say Thanks!</a></p>2731<p><iframe src="https://ghbtns.com/github-btn.html?user=kennethreitz&type=follow&count=false"32 allowtransparency="true" frameborder="0" scrolling="0" width="200" height="20"></iframe></p>3334<p><a href="https://twitter.com/kennethreitz" class="twitter-follow-button" data-show-count="false">Follow @kennethreitz</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script></p>
31 unmodified lines
added:docs/community/sponsors.rst+96 added
1Community Sponsors2==================34**tl;dr**: Requests development is currently `funded by the Python community <https://www.kennethreitz.org/requests3>`_, and5some wonderful organizations that utilize the software in their businesses.678-------------------91011Requests is one of the most heavily–utilized Python packages in the world.1213It is used by major corporations worldwide for all tasks, both small and large — from writing one–off scripts to orchestrating millions of dollars of critical infrastructure.1415It's even embedded within pip, that tool that you use to install packages and deploy with every day!1617After losing our primary open source maintainer (who was sponsored by a company to work on Requests, and other projects, full–time), we are seeking community financial contributions towards the development of Requests 3.0.1819Patron Sponsors20----------------212223`Linode — SSD Cloud Hosting & Linux Servers <https://www.linode.com>`_24//////////////////////////////////////////////////////////////////////2526Whether you’re just getting started or deploying a complex system, launching a Linode cloud server has never been easier. They offer the fastest hardware and network in the industry with scalable environments, and their 24x7 customer support team is always standing by to help with any questions.2728✨🍰✨29//////3031----------------------------------3233This slot is reserved for ethical organizations willing to invest $10,000 or more in Requests per year.3435By becoming a patron–level sponsor, your organization will receive the following benefits:3637- Prominent placement on the Requests documentation sidebar (~11,000 uniques / day).38- Honorable mention here, with logo.39- Peace of mind knowing that the infrastructure you rely on is being actively maintained.4041Organizations that sign up will be listed in order — first come first serve!4243Major Sponsors44--------------4546The following organizations have significantly contributed towards Requests' sustainability:4748`Slack — Bring your team together <https://slack.com>`_49///////////////////////////////////////////////////////5051Slack was extremely kind to be the first organization to generously donate a large sum towards the `2018 Requests 3.0 fundraiser <https://www.kennethreitz.org/requests3>`_, surpassing our entire fundraising goal immediately! They are helping the world become a better place through connectiveness, and reducing the amount of email we all have52to deal with on a daily basis.5354P.S. They're `hiring <https://slack.com/careers#openings>`_!555657`Twilio — Voice, SMS, and Video for Humans <https://www.twilio.com>`_58/////////////////////////////////////////////////////////////////////5960Twilio was the second organization to generously donate a large sum towards the `2018 Requests 3.0 fundraiser <https://www.kennethreitz.org/requests3>`_, matching the donation of Slack! They are helping the world become a better place through interconnectivity,61providing easy–to–use APIs, and empowering developers world-over to help humans communicate in meaningful and effictive ways.626364`Azure Cloud Developer Advocates <https://developer.microsoft.com/en-us/advocates/>`_65/////////////////////////////////////////////////////////////////////////////////////6667Azure was the third organization to generously donate a large sum towards the `2018 Requests 3.0 fundraiser <https://www.kennethreitz.org/requests3>`_, matching the donation of Twilio! Awesome group of generous folks :)686970`Niteo — Web Systems Development <https://www.niteoweb.com>`_71/////////////////////////////////////////////////////////////7273Niteo was the fourth company to generously donate towards the `2018 Requests 3.0 fundraiser <https://www.kennethreitz.org/requests3>`_. Niteo is a company employing tech enthusiasts from all over the world74who love to build great stuff.757677`Heroku <https://heroku.com/python>`_78/////////////////////////////////////7980Heroku has allowed Kenneth Reitz to work on some open source projects during work hours,81including Requests (but mostly Pipenv), from time–to–time, so they are listed82here as an honorable mention.8384----------------8586If your organization is interested in becoming either a sponsor or a patron, please `send us an email <mailto:me@kennethreitz.org>`_.878889Individual Sponsors90-------------------9192Countless individuals, too many to list here, have individually contributed towards the sustainability of the Requests93project over the years. Some, financially, others, with code. Contributions (from humans) of all kinds are greatly94appreciated.9596✨🍰✨
modified:docs/user/advanced.rst+3 added-3 removed
285 unmodified lines
286For the sake of security we recommend upgrading certifi frequently!287288.. _HTTP persistent connection: https://en.wikipedia.org/wiki/HTTP_persistent_connection289.. _connection pooling: https://urllib3.readthedocs.io/en/latest/reference/index.html#module-urllib3.connectionpool290.. _certifi: http://certifi.io/290.. _certifi: https://certifiio.readthedocs.io/291.. _Mozilla trust store: https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt292293.. _body-content-workflow:294
153 unmodified lines
448If an error occurs while executing your callback, a warning is given.449450If the callback function returns a value, it is assumed that it is to451replace the data that was passed in. If the function doesn't return452anything, nothing else is effected.452anything, nothing else is affected.453454::455456 def record_hook(r, *args, **kwargs):
198 unmodified lines
655When you receive a response, Requests makes a guess at the encoding to656use for decoding the response when you access the :attr:`Response.text657<requests.Response.text>` attribute. Requests will first check for an658encoding in the HTTP header, and if none is present, will use `chardet659<https://pypi.python.org/pypi/chardet>`_ to attempt to guess the encoding.659<https://pypi.org/project/chardet/>`_ to attempt to guess the encoding.660661The only time Requests will not do this is if no explicit charset662is present in the HTTP headers **and** the ``Content-Type``663header contains ``text``. In this situation, `RFC 2616
372 unmodified lines
modified:docs/user/quickstart.rst+2 added
281 unmodified lines
282 >>> r = requests.post(url, json=payload)283284Note, the ``json`` parameter is ignored if either ``data`` or ``files`` is passed.285286Using the ``json`` parameter in the request will change the ``Content-Type`` in the header to ``application/json``.287288POST a Multipart-Encoded File289-----------------------------290291Requests makes it simple to upload Multipart-encoded files::
267 unmodified lines
modified:docs/index.rst+11 added-6 removed
7 unmodified lines
89Release v\ |version|. (:ref:`Installation <install>`)1011.. image:: https://img.shields.io/pypi/l/requests.svg12 :target: https://pypi.python.org/pypi/requests12 :target: https://pypi.org/project/requests/1314.. image:: https://img.shields.io/pypi/wheel/requests.svg15 :target: https://pypi.python.org/pypi/requests15 :target: https://pypi.org/project/requests/1617.. image:: https://img.shields.io/pypi/pyversions/requests.svg18 :target: https://pypi.python.org/pypi/requests18 :target: https://pypi.org/project/requests/1920.. image:: https://codecov.io/github/requests/requests/coverage.svg?branch=master21 :target: https://codecov.io/github/requests/requests22 :alt: codecov.io
40 unmodified lines
63PayPal, NPR, Obama for America, Transifex, Native Instruments, The Washington64Post, SoundCloud, Kippt, Sony, and Federal U.S.65Institutions that prefer to be unnamed claim to use Requests internally.6667**Armin Ronacher**—67**Armin Ronacher**, creator of Flask—68 *Requests is the perfect example how beautiful an API can be with the69 right level of abstraction.*7071**Matt DeBoard**—
1 unmodified line
73 on my body, somehow. The whole thing.*7475**Daniel Greenfeld**—76 *Nuked a 1200 LOC spaghetti code library with 10 lines of code thanks to77 Kenneth Reitz's request library. Today has been AWESOME.*77 Kenneth Reitz's Requests library. Today has been AWESOME.*7879**Kenny Meyers**—80 *Python HTTP: When in doubt, or when not in doubt, use Requests. Beautiful,81 simple, Pythonic.*8283Requests is one of the most downloaded Python packages of all time, pulling in84over 13,000,000 downloads every month. All the cool kids are doing it!84over 400,000 downloads **each day**. Join the party!8586If your organization uses Requests internally, consider `supporting the development of 3.0 <https://www.kennethreitz.org/requests3>`_. Your87generosity will be greatly appreciated, and help drive the project forward88into the future.8990Beloved Features91----------------9293Requests is ready for today's web.
42 unmodified lines
136137.. toctree::138 :maxdepth: 2139140 community/sponsors141 community/recommended142 community/faq143 community/out-there144 community/support
32 unmodified lines
modified:requests/api.py+1 added-1 removed
18 unmodified lines
19 :param method: method for the new :class:`Request` object.20 :param url: URL for the new :class:`Request` object.21 :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`.22 :param data: (optional) Dictionary or list of tuples ``[(key, value)]`` (will be form-encoded), bytes, or file-like object to send in the body of the :class:`Request`.23 :param json: (optional) json data to send in the body of the :class:`Request`.23 :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`.24 :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`.25 :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`.26 :param files: (optional) Dictionary of ``'name': file-like-objects`` (or ``{'name': file-tuple}``) for multipart encoding upload.27 ``file-tuple`` can be a 2-tuple ``('filename', fileobj)``, 3-tuple ``('filename', fileobj, 'content_type')``
125 unmodified lines
modified:requests/utils.py+2 added
694 unmodified lines
695 Returns whether we should bypass proxies or not.696697 :rtype: bool698 """699 # Prioritize lowercase environment variables over uppercase700 # to keep a consistent behaviour with other http projects (curl, wget).701 get_proxy = lambda k: os.environ.get(k) or os.environ.get(k.upper())702703 # First check whether no_proxy is defined. If it is, check that the URL704 # we're getting isn't in the no_proxy list.
273 unmodified lines
modified:.gitignore+2 added
19 unmodified lines
20t.py2122t2.py23dist2425/.mypy_cache/
modified:appveyor.yml+2 added-1 removed
39 unmodified lines
40 - "python -c \"import struct; print(struct.calcsize('P') * 8)\""4142 # Upgrade to the latest version of pip to avoid it displaying warnings43 # about it being out of date.44 - "pip install --disable-pip-version-check --user --upgrade pip"44 - "python -m pip install --upgrade pip wheel"45 - "C:\\MinGW\\bin\\mingw32-make"46 - "pipenv install -e .[socks] --skip-lock"4748test_script:49 - "C:\\MinGW\\bin\\mingw32-make coverage"50
2 unmodified lines
modified:AUTHORS.rst+8 added-4 removed
1Requests is written and maintained by Kenneth Reitz and2various contributors:34Keepers of the Four Crystals5````````````````````````````4Keepers of the Crystals5```````````````````````67- Kenneth Reitz <me@kennethreitz.org> `@kennethreitz <https://github.com/kennethreitz>`_, Keeper of the Master Crystal.8- Ian Cordasco <graffatcolmingov@gmail.com> `@sigmavirus24 <https://github.com/sigmavirus24>`_.9- Nate Prewitt <nate.prewitt@gmail.com> `@nateprewitt <https://github.com/nateprewitt>`_.1011Previous Keepers of Crystals12````````````````````````````1314- Cory Benfield <cory@lukasa.co.uk> `@lukasa <https://github.com/lukasa>`_9- Ian Cordasco <graffatcolmingov@gmail.com> `@sigmavirus24 <https://github.com/sigmavirus24>`_10- Nate Prewitt <nate.prewitt@gmail.com> `@nateprewitt <https://github.com/nateprewitt>`_151617Patches and Suggestions18```````````````````````
171 unmodified lines
modified:LICENSE+1 added-1 removed
1Copyright 2017 Kenneth Reitz1Copyright 2018 Kenneth Reitz23 Licensed under the Apache License, Version 2.0 (the "License");4 you may not use this file except in compliance with the License.5 You may obtain a copy of the License at
8 unmodified lines
modified:Pipfile+9 added-9 removed
1[[source]]2url = "https://pypi.python.org/simple"2url = "https://pypi.org/simple/"3verify_ssl = true4name = "pypi"56[dev-packages]67pytest = ">=2.8.0"8codecov = "*"9"pytest-httpbin" = "==0.0.7"10"pytest-mock" = "*"11"pytest-cov" = "*"12"pytest-xdist" = "*"9pytest-httpbin = ">=0.0.7"10pytest-mock = "*"11pytest-cov = "*"12pytest-xdist = "*"13alabaster = "*"14"readme-renderer" = "*"14readme-renderer = "*"15sphinx = "<=1.5.5"16pysocks = "*"17docutils = "*"18"flake8" = "*"19tox = "*"20detox = "*"21httpbin = "==0.5.0"21httpbin = ">=0.7.0"2223[packages]24"e1839a8" = {path = ".", editable = true, extras=["socks"]}24"e1839a8" = {path = ".", editable = true, extras = ["socks"]}
modified:README.rst+3 added-3 removed
1Requests: HTTP for Humans2=========================34.. image:: https://img.shields.io/pypi/v/requests.svg5 :target: https://pypi.python.org/pypi/requests5 :target: https://pypi.org/project/requests/67.. image:: https://img.shields.io/pypi/l/requests.svg8 :target: https://pypi.python.org/pypi/requests8 :target: https://pypi.org/project/requests/910.. image:: https://img.shields.io/pypi/pyversions/requests.svg11 :target: https://pypi.python.org/pypi/requests11 :target: https://pypi.org/project/requests/1213.. image:: https://codecov.io/github/requests/requests/coverage.svg?branch=master14 :target: https://codecov.io/github/requests/requests15 :alt: codecov.io
95 unmodified lines