Added HTTPHeaderDict to top level module
MODIFY
CONTRIBUTORS.txt
CONTRIBUTORS.txt
@@ -312,5 +312,8 @@ In chronological order:
* Dmitry Mazin <https://archvile.net>
* _put_conn changes and unit tests
+* Ubdussamad <ubdussamad@gmail.com>
+ * Added HTTPHeaderDict to top level objects and added relevant usage documentation for the same.
+
* [Your name or handle] <[email or website]>
* [Brief summary of your changes]

MODIFY
docs/user-guide.rst
docs/user-guide.rst
@@ -147,6 +147,23 @@ You can specify headers as a dictionary in the ``headers`` argument in :meth:`~p
>>> json.loads(r.data.decode('utf-8'))['headers']
{'X-Something': 'value', ...}
+Or you can use the ``HTTPHeaderDict`` class to create multi-valued HTTP headers:
+
+.. code-block:: pycon
+
+ >>> from urllib3 import HTTPHeaderDict
+ >>> headers = HTTPHeaderDict()
+ >>> headers.add('Accept', 'application/json')
+ >>> headers.add('Accept', 'text/plain')
+ >>> r = http.request(
+ ... 'GET',
+ ... 'http://httpbin.org/headers',
+ ... headers=headers
+ ... )
+ >>> json.loads(r.data.decode('utf-8'))['headers']
+ {'Accept': 'application/json, text/plain', ...}
+
+
Query Parameters
~~~~~~~~~~~~~~~~

MODIFY
src/urllib3/__init__.py
src/urllib3/__init__.py
@@ -8,6 +8,7 @@ import warnings
from logging import NullHandler
from . import exceptions
+from ._collections import HTTPHeaderDict
from ._version import __version__
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
from .filepost import encode_multipart_formdata
@@ -23,6 +24,7 @@ __version__ = __version__
__all__ = (
"HTTPConnectionPool",
+ "HTTPHeaderDict",
"HTTPSConnectionPool",
"PoolManager",
"ProxyManager",

Added HTTPHeaderDict to top level module