| 1 |
urllib3 |
| 2 |
======= |
| 3 |
|
| 4 |
.. toctree:: |
| 5 |
:hidden: |
| 6 |
:maxdepth: 3 |
| 7 |
|
| 8 |
For Enterprise <https://tidelift.com/subscription/pkg/pypi-urllib3?utm_source=pypi-urllib3&utm_medium=referral&utm_campaign=docs> |
| 9 |
Community Discord <https://discord.gg/urllib3> |
| 10 |
sponsors |
| 11 |
user-guide |
| 12 |
advanced-usage |
| 13 |
reference/index |
| 14 |
contributing |
| 15 |
changelog |
| 16 |
v2-migration-guide |
| 17 |
|
| 18 |
urllib3 is a powerful, *user-friendly* HTTP client for Python. |
| 19 |
:ref:`Much of the Python ecosystem already uses <who-uses>` urllib3 and you should too. |
| 20 |
|
| 21 |
urllib3 brings many critical features that are missing from the Python |
| 22 |
standard libraries: |
| 23 |
|
| 24 |
- Thread safety. |
| 25 |
- Connection pooling. |
| 26 |
- Client-side TLS/SSL verification. |
| 27 |
- File uploads with multipart encoding. |
| 28 |
- Helpers for retrying requests and dealing with HTTP redirects. |
| 29 |
- Support for gzip, deflate, brotli, and zstd encoding. |
| 30 |
- Proxy support for HTTP and SOCKS. |
| 31 |
- 100% test coverage. |
| 32 |
|
| 33 |
urllib3 is powerful and easy to use: |
| 34 |
|
| 35 |
.. code-block:: pycon |
| 36 |
|
| 37 |
>>> import urllib3 |
| 38 |
>>> resp = urllib3.request("GET", "https://httpbin.org/robots.txt") |
| 39 |
>>> resp.status |
| 40 |
200 |
| 41 |
>>> resp.data |
| 42 |
b"User-agent: *\nDisallow: /deny\n" |
| 43 |
|
| 44 |
For Enterprise |
| 45 |
-------------- |
| 46 |
|
| 47 |
.. |tideliftlogo| image:: https://nedbatchelder.com/pix/Tidelift_Logos_RGB_Tidelift_Shorthand_On-White_small.png |
| 48 |
:width: 75 |
| 49 |
:alt: Tidelift |
| 50 |
|
| 51 |
.. list-table:: |
| 52 |
:widths: 10 100 |
| 53 |
|
| 54 |
* - |tideliftlogo|_ |
| 55 |
- Professional support for urllib3 is available as part of the `Tidelift |
| 56 |
Subscription`_. Tidelift gives software development teams a single source for |
| 57 |
purchasing and maintaining their software, with professional grade assurances |
| 58 |
from the experts who know it best, while seamlessly integrating with existing |
| 59 |
tools. |
| 60 |
|
| 61 |
.. _Tidelift Subscription: https://tidelift.com/subscription/pkg/pypi-urllib3?utm_source=pypi-urllib3&utm_medium=referral&utm_campaign=docs |
| 62 |
.. _tideliftlogo: https://tidelift.com/subscription/pkg/pypi-urllib3?utm_source=pypi-urllib3&utm_medium=referral&utm_campaign=docs |
| 63 |
|
| 64 |
|learn-more|_ |request-a-demo|_ |
| 65 |
|
| 66 |
.. |learn-more| image:: https://raw.githubusercontent.com/urllib3/urllib3/master/docs/images/learn-more-button.png |
| 67 |
:width: 49% |
| 68 |
:alt: Learn more about Tidelift Subscription |
| 69 |
.. _learn-more: https://tidelift.com/subscription/pkg/pypi-urllib3?utm_source=pypi-urllib3&utm_medium=referral&utm_campaign=docs |
| 70 |
|
| 71 |
.. |request-a-demo| image:: https://raw.githubusercontent.com/urllib3/urllib3/master/docs/images/demo-button.png |
| 72 |
:width: 49% |
| 73 |
:alt: Request a Demo for the Tidelift Subscription |
| 74 |
.. _request-a-demo: https://tidelift.com/subscription/request-a-demo?utm_source=pypi-urllib3&utm_medium=referral&utm_campaign=docs |
| 75 |
|
| 76 |
Installing |
| 77 |
---------- |
| 78 |
|
| 79 |
urllib3 can be installed with `pip <https://pip.pypa.io>`_ |
| 80 |
|
| 81 |
.. code-block:: bash |
| 82 |
|
| 83 |
$ python -m pip install urllib3 |
| 84 |
|
| 85 |
Alternatively, you can grab the latest source code from `GitHub <https://github.com/urllib3/urllib3>`_: |
| 86 |
|
| 87 |
.. code-block:: bash |
| 88 |
|
| 89 |
$ git clone https://github.com/urllib3/urllib3.git |
| 90 |
$ cd urllib3 |
| 91 |
$ pip install . |
| 92 |
|
| 93 |
Usage |
| 94 |
----- |
| 95 |
|
| 96 |
The :doc:`user-guide` is the place to go to learn how to use the library and |
| 97 |
accomplish common tasks. The more in-depth :doc:`advanced-usage` guide is the place to go for lower-level tweaking. |
| 98 |
|
| 99 |
The :doc:`reference/index` documentation provides API-level documentation. |
| 100 |
|
| 101 |
.. _who-uses: |
| 102 |
|
| 103 |
Who uses urllib3? |
| 104 |
----------------- |
| 105 |
|
| 106 |
`urllib3 is one of the most downloaded packages on PyPI <https://pypistats.org/top>`_ |
| 107 |
and is a dependency of many popular Python packages like `Requests <https://requests.readthedocs.io>`_, |
| 108 |
`Pip <https://pip.pypa.io>`_, and more! |
| 109 |
|
| 110 |
License |
| 111 |
------- |
| 112 |
|
| 113 |
urllib3 is made available under the MIT License. For more details, see `LICENSE.txt <https://github.com/urllib3/urllib3/blob/master/LICENSE.txt>`_. |
| 114 |
|
| 115 |
Contributing |
| 116 |
------------ |
| 117 |
|
| 118 |
We happily welcome contributions, please see :doc:`contributing` for details. |