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
Provenance
- Commit
371ee7c- Tree
36db33b- Author
Ian Stapleton Cordasco <graffatcolmingov@gmail.com>- Committer
GitHub <noreply@github.com>- Parent 1
85ec7d7- Parent 2
80e2637
19 files changed+209 added−38 removed
added:.github/ISSUE_TEMPLATE/Bug_report.md+34 added
12345678910111213141516171819202122232425262728293031323334---name: Bug reportabout: Create a report to help us improve
---
Summary.
## Expected Result
What you expected.
## Actual Result
What happened instead.
## Reproduction Steps
```pythonimport requests
```
## System Information
$ python -m requests.help
```<paste here>```
This command is only available on Requests v2.16.4 and greater. Otherwise,please provide some basic information about your system (Python version,operating system, &c).added:.github/ISSUE_TEMPLATE/Custom.md+7 added
1234567---name: Request for Helpabout: Guidance on using Requests.
---
Please refer to our [StackOverflow tag](https://stackoverflow.com/questions/tagged/python-requests) for guidance.added:.github/ISSUE_TEMPLATE/Feature_request.md+7 added
1234567---name: Feature requestabout: Suggest an idea for this project
---
Requests is not accepting feature requests at this time.modified:docs/_static/custom.css+8 added
12345678910111235 unmodified linesbody > div.document > div.sphinxsidebar > div > form > table > tbody > tr:nth-child(2) > td > select { width: 100%!important;}
#python27 > a { color: white;}
#carbonads { display: block; overflow: hidden; padding: 1em;35 unmodified linesmodified:docs/_templates/hacks.html+3 added-4 removed
12343456710 unmodified lines18192021232223242526272830293031323352 unmodified lines<!-- Alabaster (krTheme++) Hacks --><aside id="python27"> Python 3, the new best practice, is here to stay. Python 2 will retire in only <time></time> months! <a href="https://www.kennethreitz.org/requests3"><strong>Requests 3.0</strong> development is underway, and your financial help is appreciated!</a></aside>
<!-- Python 2 Death Clock™ --><style type="text/css">10 unmodified lines line-height: 3; }
</style><script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script><!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script><script> var death = new Date('2020-04-12');
var diff = moment.duration(death - moment());
document.querySelector('#python27 time').innerText = (diff.years() * 12) + diff.months();</script></script> -->
<!-- CSS Adjustments (I'm very picky.) --><style type="text/css">52 unmodified linesmodified:docs/_templates/sidebarintro.html+4 added-3 removed
11 unmodified lines12 <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>17 18+19 <script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=pythonrequestsorg" id="_carbonads_js"></script>20 19-<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>24 25 <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>27 28 <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>31 32 <p>More <a href="http://kennethreitz.org/">Kenneth Reitz</a> projects:</p>17 unmodified lines50 51 <p></p>52 53 <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 linesmodified:docs/_templates/sidebarlogo.html+6 added-3 removed
6 unmodified lines7 <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>10 11+12 <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>17+18+<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>19+20 <h3>Stay Informed</h3>21 <p>Receive updates on new releases and upcoming projects.</p>22 23+<p><a href="http://www.unixstickers.com/stickers/coding_stickers/requests-shaped-sticker">Requests Stickers!</a></p>24+25 <p><a href="http://tinyletter.com/kennethreitz">Join Mailing List</a>.</p>26 27 <hr/>28 29 <script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=pythonrequestsorg" id="_carbonads_js"></script>30 26-<p>If you enjoy using this project, <a href="https://saythanks.io/to/kennethreitz">Say Thanks!</a></p>27-31 <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>33 34 <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 linesadded:docs/community/sponsors.rst+96 added
1+Community Sponsors2+==================3+4+**tl;dr**: Requests development is currently `funded by the Python community <https://www.kennethreitz.org/requests3>`_, and5+some wonderful organizations that utilize the software in their businesses.6+7+8+-------------------9+10+11+Requests is one of the most heavily–utilized Python packages in the world.12+13+It 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.14+15+It's even embedded within pip, that tool that you use to install packages and deploy with every day!16+17+After 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.18+19+Patron Sponsors20+----------------21+22+23+`Linode — SSD Cloud Hosting & Linux Servers <https://www.linode.com>`_24+//////////////////////////////////////////////////////////////////////25+26+Whether 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.27+28+✨🍰✨29+//////30+31+----------------------------------32+33+This slot is reserved for ethical organizations willing to invest $10,000 or more in Requests per year.34+35+By becoming a patron–level sponsor, your organization will receive the following benefits:36+37+- 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.40+41+Organizations that sign up will be listed in order — first come first serve!42+43+Major Sponsors44+--------------45+46+The following organizations have significantly contributed towards Requests' sustainability:47+48+`Slack — Bring your team together <https://slack.com>`_49+///////////////////////////////////////////////////////50+51+Slack 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 have52+to deal with on a daily basis.53+54+P.S. They're `hiring <https://slack.com/careers#openings>`_!55+56+57+`Twilio — Voice, SMS, and Video for Humans <https://www.twilio.com>`_58+/////////////////////////////////////////////////////////////////////59+60+Twilio 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,61+providing easy–to–use APIs, and empowering developers world-over to help humans communicate in meaningful and effictive ways.62+63+64+`Azure Cloud Developer Advocates <https://developer.microsoft.com/en-us/advocates/>`_65+/////////////////////////////////////////////////////////////////////////////////////66+67+Azure 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 :)68+69+70+`Niteo — Web Systems Development <https://www.niteoweb.com>`_71+/////////////////////////////////////////////////////////////72+73+Niteo 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 world74+who love to build great stuff.75+76+77+`Heroku <https://heroku.com/python>`_78+/////////////////////////////////////79+80+Heroku has allowed Kenneth Reitz to work on some open source projects during work hours,81+including Requests (but mostly Pipenv), from time–to–time, so they are listed82+here as an honorable mention.83+84+----------------85+86+If your organization is interested in becoming either a sponsor or a patron, please `send us an email <mailto:me@kennethreitz.org>`_.87+88+89+Individual Sponsors90+-------------------91+92+Countless individuals, too many to list here, have individually contributed towards the sustainability of the Requests93+project over the years. Some, financially, others, with code. Contributions (from humans) of all kinds are greatly94+appreciated.95+96+✨🍰✨modified:docs/user/advanced.rst+3 added-3 removed
285 unmodified lines286 For the sake of security we recommend upgrading certifi frequently!287 288 .. _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.txt292 293 .. _body-content-workflow:294 153 unmodified lines448 If an error occurs while executing your callback, a warning is given.449 450 If the callback function returns a value, it is assumed that it is to451 replace the data that was passed in. If the function doesn't return452-anything, nothing else is effected.452+anything, nothing else is affected.453 454 ::455 456 def record_hook(r, *args, **kwargs):198 unmodified lines655 When you receive a response, Requests makes a guess at the encoding to656 use for decoding the response when you access the :attr:`Response.text657 <requests.Response.text>` attribute. Requests will first check for an658 encoding 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.660 661 The only time Requests will not do this is if no explicit charset662 is present in the HTTP headers **and** the ``Content-Type``663 header contains ``text``. In this situation, `RFC 2616372 unmodified linesmodified:docs/user/quickstart.rst+2 added
281 unmodified lines282 >>> r = requests.post(url, json=payload)283 284 Note, the ``json`` parameter is ignored if either ``data`` or ``files`` is passed.285 286+Using the ``json`` parameter in the request will change the ``Content-Type`` in the header to ``application/json``.287+288 POST a Multipart-Encoded File289 -----------------------------290 291 Requests makes it simple to upload Multipart-encoded files::267 unmodified linesmodified:docs/index.rst+11 added-6 removed
7 unmodified lines8 9 Release v\ |version|. (:ref:`Installation <install>`)10 11 .. image:: https://img.shields.io/pypi/l/requests.svg12- :target: https://pypi.python.org/pypi/requests12+ :target: https://pypi.org/project/requests/13 14 .. image:: https://img.shields.io/pypi/wheel/requests.svg15- :target: https://pypi.python.org/pypi/requests15+ :target: https://pypi.org/project/requests/16 17 .. image:: https://img.shields.io/pypi/pyversions/requests.svg18- :target: https://pypi.python.org/pypi/requests18+ :target: https://pypi.org/project/requests/19 20 .. image:: https://codecov.io/github/requests/requests/coverage.svg?branch=master21 :target: https://codecov.io/github/requests/requests22 :alt: codecov.io40 unmodified lines63 PayPal, NPR, Obama for America, Transifex, Native Instruments, The Washington64 Post, SoundCloud, Kippt, Sony, and Federal U.S.65 Institutions that prefer to be unnamed claim to use Requests internally.66 67-**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.*70 71 **Matt DeBoard**—1 unmodified line73 on my body, somehow. The whole thing.*74 75 **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.*78 79 **Kenny Meyers**—80 *Python HTTP: When in doubt, or when not in doubt, use Requests. Beautiful,81 simple, Pythonic.*82 83 Requests is one of the most downloaded Python packages of all time, pulling in84-over 13,000,000 downloads every month. All the cool kids are doing it!84+over 400,000 downloads **each day**. Join the party!85 86+If your organization uses Requests internally, consider `supporting the development of 3.0 <https://www.kennethreitz.org/requests3>`_. Your87+generosity will be greatly appreciated, and help drive the project forward88+into the future.89+90 Beloved Features91 ----------------92 93 Requests is ready for today's web.42 unmodified lines136 137 .. toctree::138 :maxdepth: 2139 140+ community/sponsors141 community/recommended142 community/faq143 community/out-there144 community/support32 unmodified linesmodified:requests/api.py+1 added-1 removed
18 unmodified lines19 :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 linesmodified:requests/utils.py+2 added
694 unmodified lines695 Returns whether we should bypass proxies or not.696 697 :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())702 703 # 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 linesmodified:.gitignore+2 added
19 unmodified lines20 t.py21 22 t2.py23 dist24+25+/.mypy_cache/modified:appveyor.yml+2 added-1 removed
39 unmodified lines40 - "python -c \"import struct; print(struct.calcsize('P') * 8)\""41 42 # 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"47 48 test_script:49 - "C:\\MinGW\\bin\\mingw32-make coverage"50 2 unmodified linesmodified:AUTHORS.rst+8 added-4 removed
1 Requests is written and maintained by Kenneth Reitz and2 various contributors:3 4-Keepers of the Four Crystals5-````````````````````````````4+Keepers of the Crystals5+```````````````````````6 7 - 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>`_.10+11+Previous Keepers of Crystals12+````````````````````````````13+14 - 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>`_15 16 17 Patches and Suggestions18 ```````````````````````171 unmodified linesmodified:LICENSE+1 added-1 removed
1-Copyright 2017 Kenneth Reitz1+Copyright 2018 Kenneth Reitz2 3 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 at8 unmodified linesmodified:Pipfile+9 added-9 removed
1 [[source]]2-url = "https://pypi.python.org/simple"2+url = "https://pypi.org/simple/"3 verify_ssl = true4+name = "pypi"5 6 [dev-packages]6-7 pytest = ">=2.8.0"8 codecov = "*"9-"pytest-httpbin" = "==0.0.7"10-"pytest-mock" = "*"11-"pytest-cov" = "*"12-"pytest-xdist" = "*"9+pytest-httpbin = ">=0.0.7"10+pytest-mock = "*"11+pytest-cov = "*"12+pytest-xdist = "*"13 alabaster = "*"14-"readme-renderer" = "*"14+readme-renderer = "*"15 sphinx = "<=1.5.5"16 pysocks = "*"17 docutils = "*"18 "flake8" = "*"19 tox = "*"20 detox = "*"21-httpbin = "==0.5.0"21+httpbin = ">=0.7.0"22 23 [packages]24-"e1839a8" = {path = ".", editable = true, extras=["socks"]}24+"e1839a8" = {path = ".", editable = true, extras = ["socks"]}modified:README.rst+3 added-3 removed
1 Requests: HTTP for Humans2 =========================3 4 .. image:: https://img.shields.io/pypi/v/requests.svg5- :target: https://pypi.python.org/pypi/requests5+ :target: https://pypi.org/project/requests/6 7 .. image:: https://img.shields.io/pypi/l/requests.svg8- :target: https://pypi.python.org/pypi/requests8+ :target: https://pypi.org/project/requests/9 10 .. image:: https://img.shields.io/pypi/pyversions/requests.svg11- :target: https://pypi.python.org/pypi/requests11+ :target: https://pypi.org/project/requests/12 13 .. image:: https://codecov.io/github/requests/requests/coverage.svg?branch=master14 :target: https://codecov.io/github/requests/requests15 :alt: codecov.io95 unmodified lines