{
    "content": [
        {
            "type": "text",
            "text": "# urllib3 (pydoc)\n\n**Summary:** urllib3 - Python HTTP library with thread-safe connection pooling, file post support, user friendly, and more\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **PACKAGE CONTENTS** (14 lines)\n- **CLASSES** (14 lines) — 7 subsections\n  - class HTTPConnectionPool (307 lines)\n  - class HTTPResponse (266 lines)\n  - class HTTPSConnectionPool (250 lines)\n  - class PoolManager (154 lines)\n  - class ProxyManager (165 lines)\n  - class Retry (218 lines)\n  - class Timeout (170 lines)\n- **FUNCTIONS** (1 lines) — 7 subsections\n  - add_stderr_logger (5 lines)\n  - connection_from_url (18 lines)\n  - disable_warnings (2 lines)\n  - encode_multipart_formdata (9 lines)\n  - get_host (2 lines)\n  - make_headers (33 lines)\n  - proxy_from_url (1 lines)\n- **DATA** (3 lines)\n- **VERSION** (2 lines)\n- **AUTHOR** (2 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\nurllib3 - Python HTTP library with thread-safe connection pooling, file post support, user friendly, and more\n\n### PACKAGE CONTENTS\n\ncollections\nversion\nconnection\nconnectionpool\ncontrib (package)\nexceptions\nfields\nfilepost\npackages (package)\npoolmanager\nrequest\nresponse\nutil (package)\n\n### CLASSES\n\nbuiltins.object\nurllib3.util.retry.Retry\nurllib3.util.timeout.Timeout\nio.IOBase(io.IOBase)\nurllib3.response.HTTPResponse\nurllib3.connectionpool.ConnectionPool(builtins.object)\nurllib3.connectionpool.HTTPConnectionPool(urllib3.connectionpool.ConnectionPool, urllib3.request.RequestMethods)\nurllib3.connectionpool.HTTPSConnectionPool\nurllib3.request.RequestMethods(builtins.object)\nurllib3.connectionpool.HTTPConnectionPool(urllib3.connectionpool.ConnectionPool, urllib3.request.RequestMethods)\nurllib3.connectionpool.HTTPSConnectionPool\nurllib3.poolmanager.PoolManager\nurllib3.poolmanager.ProxyManager\n\n#### class HTTPConnectionPool\n\n|  HTTPConnectionPool(host, port=None, strict=False, timeout=<object object at 0x7efc6e05cb30>, maxsize=1, block=False, headers=None, retries=None, proxy=None, proxyheaders=None, proxyconfig=None, connkw)\n|\n|  Thread-safe connection pool for one host.\n|\n|  :param host:\n|      Host used for this HTTP Connection (e.g. \"localhost\"), passed into\n|      :class:`http.client.HTTPConnection`.\n|\n|  :param port:\n|      Port used for this HTTP Connection (None is equivalent to 80), passed\n|      into :class:`http.client.HTTPConnection`.\n|\n|  :param strict:\n|      Causes BadStatusLine to be raised if the status line can't be parsed\n|      as a valid HTTP/1.0 or 1.1 status line, passed into\n|      :class:`http.client.HTTPConnection`.\n|\n|      .. note::\n|         Only works in Python 2. This parameter is ignored in Python 3.\n|\n|  :param timeout:\n|      Socket timeout in seconds for each individual connection. This can\n|      be a float or integer, which sets the timeout for the HTTP request,\n|      or an instance of :class:`urllib3.util.Timeout` which gives you more\n|      fine-grained control over request timeouts. After the constructor has\n|      been parsed, this is always a `urllib3.util.Timeout` object.\n|\n|  :param maxsize:\n|      Number of connections to save that can be reused. More than 1 is useful\n|      in multithreaded situations. If ``block`` is set to False, more\n|      connections will be created but they will not be saved once they've\n|      been used.\n|\n|  :param block:\n|      If set to True, no more than ``maxsize`` connections will be used at\n|      a time. When no free connections are available, the call will block\n|      until a connection has been released. This is a useful side effect for\n|      particular multithreaded situations where one does not want to use more\n|      than maxsize connections per host to prevent flooding.\n|\n|  :param headers:\n|      Headers to include with all requests, unless other headers are given\n|      explicitly.\n|\n|  :param retries:\n|      Retry configuration to use by default with requests in this pool.\n|\n|  :param proxy:\n|      Parsed proxy URL, should not be used directly, instead, see\n|      :class:`urllib3.ProxyManager`\n|\n|  :param proxyheaders:\n|      A dictionary with proxy headers, should not be used directly,\n|      instead, see :class:`urllib3.ProxyManager`\n|\n|  :param \\connkw:\n|      Additional parameters are used to create fresh :class:`urllib3.connection.HTTPConnection`,\n|      :class:`urllib3.connection.HTTPSConnection` instances.\n|\n|  Method resolution order:\n|      HTTPConnectionPool\n|      ConnectionPool\n|      urllib3.request.RequestMethods\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  init(self, host, port=None, strict=False, timeout=<object object at 0x7efc6e05cb30>, maxsize=1, block=False, headers=None, retries=None, proxy=None, proxyheaders=None, proxyconfig=None, connkw)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  close(self)\n|      Close all pooled connections and disable the pool.\n|\n|  issamehost(self, url)\n|      Check if the given ``url`` is a member of the same host as this\n|      connection pool.\n|\n|  urlopen(self, method, url, body=None, headers=None, retries=None, redirect=True, assertsamehost=True, timeout=<object object at 0x7efc6e05ce00>, pooltimeout=None, releaseconn=None, chunked=False, bodypos=None, responsekw)\n|      Get a connection from the pool and perform an HTTP request. This is the\n|      lowest level call for making a request, so you'll need to specify all\n|      the raw details.\n|\n|      .. note::\n|\n|         More commonly, it's appropriate to use a convenience method provided\n|         by :class:`.RequestMethods`, such as :meth:`request`.\n|\n|      .. note::\n|\n|         `releaseconn` will only behave as expected if\n|         `preloadcontent=False` because we want to make\n|         `preloadcontent=False` the default behaviour someday soon without\n|         breaking backwards compatibility.\n|\n|      :param method:\n|          HTTP request method (such as GET, POST, PUT, etc.)\n|\n|      :param url:\n|          The URL to perform the request on.\n|\n|      :param body:\n|          Data to send in the request body, either :class:`str`, :class:`bytes`,\n|          an iterable of :class:`str`/:class:`bytes`, or a file-like object.\n|\n|      :param headers:\n|          Dictionary of custom headers to send, such as User-Agent,\n|          If-None-Match, etc. If None, pool headers are used. If provided,\n|          these headers completely replace any pool-specific headers.\n|\n|      :param retries:\n|          Configure the number of retries to allow before raising a\n|          :class:`~urllib3.exceptions.MaxRetryError` exception.\n|\n|          Pass ``None`` to retry until you receive a response. Pass a\n|          :class:`~urllib3.util.retry.Retry` object for fine-grained control\n|          over different types of retries.\n|          Pass an integer number to retry connection errors that many times,\n|          but no other types of errors. Pass zero to never retry.\n|\n|          If ``False``, then retries are disabled and any exception is raised\n|          immediately. Also, instead of raising a MaxRetryError on redirects,\n|          the redirect response will be returned.\n|\n|      :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int.\n|\n|      :param redirect:\n|          If True, automatically handle redirects (status codes 301, 302,\n|          303, 307, 308). Each redirect counts as a retry. Disabling retries\n|          will disable redirect, too.\n|\n|      :param assertsamehost:\n|          If ``True``, will make sure that the host of the pool requests is\n|          consistent else will raise HostChangedError. When ``False``, you can\n|          use the pool on an HTTP proxy and request foreign hosts.\n|\n|      :param timeout:\n|          If specified, overrides the default timeout for this one\n|          request. It may be a float (in seconds) or an instance of\n|          :class:`urllib3.util.Timeout`.\n|\n|      :param pooltimeout:\n|          If set and the pool is set to block=True, then this method will\n|          block for ``pooltimeout`` seconds and raise EmptyPoolError if no\n|          connection is available within the time period.\n|\n|      :param releaseconn:\n|          If False, then the urlopen call will not release the connection\n|          back into the pool once a response is received (but will release if\n|          you read the entire contents of the response such as when\n|          `preloadcontent=True`). This is useful if you're not preloading\n|          the response's content immediately. You will need to call\n|          ``r.releaseconn()`` on the response ``r`` to return the connection\n|          back into the pool. If None, it takes the value of\n|          ``responsekw.get('preloadcontent', True)``.\n|\n|      :param chunked:\n|          If True, urllib3 will send the body using chunked transfer\n|          encoding. Otherwise, urllib3 will send the body using the standard\n|          content-length form. Defaults to False.\n|\n|      :param int bodypos:\n|          Position to seek to in file-like body in the event of a retry or\n|          redirect. Typically this won't need to be set because urllib3 will\n|          auto-populate the value when needed.\n|\n|      :param \\responsekw:\n|          Additional parameters are passed to\n|          :meth:`urllib3.response.HTTPResponse.fromhttplib`\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  ConnectionCls = <class 'urllib3.connection.HTTPConnection'>\n|      Based on :class:`http.client.HTTPConnection` but provides an extra constructor\n|      backwards-compatibility layer between older and newer Pythons.\n|\n|      Additional keyword parameters are used to configure attributes of the connection.\n|      Accepted parameters include:\n|\n|      - ``strict``: See the documentation on :class:`urllib3.connectionpool.HTTPConnectionPool`\n|      - ``sourceaddress``: Set the source address for the current connection.\n|      - ``socketoptions``: Set specific options on the underlying socket. If not specified, then\n|        defaults are loaded from ``HTTPConnection.defaultsocketoptions`` which includes disabling\n|        Nagle's algorithm (sets TCPNODELAY to 1) unless the connection is behind a proxy.\n|\n|        For example, if you wish to enable TCP Keep Alive in addition to the defaults,\n|        you might pass:\n|\n|        .. code-block:: python\n|\n|           HTTPConnection.defaultsocketoptions + [\n|               (socket.SOLSOCKET, socket.SOKEEPALIVE, 1),\n|           ]\n|\n|        Or you may want to disable the defaults by passing an empty list (e.g., ``[]``).\n|\n|\n|  ResponseCls = <class 'urllib3.response.HTTPResponse'>\n|      HTTP Response container.\n|\n|      Backwards-compatible with :class:`http.client.HTTPResponse` but the response ``body`` is\n|      loaded and decoded on-demand when the ``data`` property is accessed.  This\n|      class is also compatible with the Python standard library's :mod:`io`\n|      module, and can hence be treated as a readable object in the context of that\n|      framework.\n|\n|      Extra parameters for behaviour not present in :class:`http.client.HTTPResponse`:\n|\n|      :param preloadcontent:\n|          If True, the response's body will be preloaded during construction.\n|\n|      :param decodecontent:\n|          If True, will attempt to decode the body based on the\n|          'content-encoding' header.\n|\n|      :param originalresponse:\n|          When this HTTPResponse wrapper is generated from an :class:`http.client.HTTPResponse`\n|          object, it's convenient to include the original for debug purposes. It's\n|          otherwise unused.\n|\n|      :param retries:\n|          The retries contains the last :class:`~urllib3.util.retry.Retry` that\n|          was used during the request.\n|\n|      :param enforcecontentlength:\n|          Enforce content length checking. Body returned by server must match\n|          value of Content-Length header, if present. Otherwise, raise error.\n|\n|\n|  scheme = 'http'\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from ConnectionPool:\n|\n|  enter(self)\n|\n|  exit(self, exctype, excval, exctb)\n|\n|  str(self)\n|      Return str(self).\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from ConnectionPool:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes inherited from ConnectionPool:\n|\n|  QueueCls = <class 'urllib3.util.queue.LifoQueue'>\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from urllib3.request.RequestMethods:\n|\n|  request(self, method, url, fields=None, headers=None, urlopenkw)\n|      Make a request using :meth:`urlopen` with the appropriate encoding of\n|      ``fields`` based on the ``method`` used.\n|\n|      This is a convenience method that requires the least amount of manual\n|      effort. It can be used in most situations, while still having the\n|      option to drop down to more specific methods when necessary, such as\n|      :meth:`requestencodeurl`, :meth:`requestencodebody`,\n|      or even the lowest level :meth:`urlopen`.\n|\n|  requestencodebody(self, method, url, fields=None, headers=None, encodemultipart=True, multipartboundary=None, urlopenkw)\n|      Make a request using :meth:`urlopen` with the ``fields`` encoded in\n|      the body. This is useful for request methods like POST, PUT, PATCH, etc.\n|\n|      When ``encodemultipart=True`` (default), then\n|      :func:`urllib3.encodemultipartformdata` is used to encode\n|      the payload with the appropriate content type. Otherwise\n|      :func:`urllib.parse.urlencode` is used with the\n|      'application/x-www-form-urlencoded' content type.\n|\n|      Multipart encoding must be used when posting files, and it's reasonably\n|      safe to use it in other times too. However, it may break request\n|      signing, such as with OAuth.\n|\n|      Supports an optional ``fields`` parameter of key/value strings AND\n|      key/filetuple. A filetuple is a (filename, data, MIME type) tuple where\n|      the MIME type is optional. For example::\n|\n|          fields = {\n|              'foo': 'bar',\n|              'fakefile': ('foofile.txt', 'contents of foofile'),\n|              'realfile': ('barfile.txt', open('realfile').read()),\n|              'typedfile': ('bazfile.bin', open('bazfile').read(),\n|                            'image/jpeg'),\n|              'nonamefile': 'contents of nonamefile field',\n|          }\n|\n|      When uploading a file, providing a filename (the first parameter of the\n|      tuple) is optional but recommended to best mimic behavior of browsers.\n|\n|      Note that if ``headers`` are supplied, the 'Content-Type' header will\n|      be overwritten because it depends on the dynamic random boundary string\n|      which is used to compose the body of the request. The random boundary\n|      string can be explicitly set with the ``multipartboundary`` parameter.\n|\n|  requestencodeurl(self, method, url, fields=None, headers=None, urlopenkw)\n|      Make a request using :meth:`urlopen` with the ``fields`` encoded in\n|      the url. This is useful for request methods like GET, HEAD, DELETE, etc.\n\n#### class HTTPResponse\n\n|  HTTPResponse(body='', headers=None, status=0, version=0, reason=None, strict=0, preloadcontent=True, decodecontent=True, originalresponse=None, pool=None, connection=None, msg=None, retries=None, enforcecontentlength=False, requestmethod=None, requesturl=None, autoclose=True)\n|\n|  HTTP Response container.\n|\n|  Backwards-compatible with :class:`http.client.HTTPResponse` but the response ``body`` is\n|  loaded and decoded on-demand when the ``data`` property is accessed.  This\n|  class is also compatible with the Python standard library's :mod:`io`\n|  module, and can hence be treated as a readable object in the context of that\n|  framework.\n|\n|  Extra parameters for behaviour not present in :class:`http.client.HTTPResponse`:\n|\n|  :param preloadcontent:\n|      If True, the response's body will be preloaded during construction.\n|\n|  :param decodecontent:\n|      If True, will attempt to decode the body based on the\n|      'content-encoding' header.\n|\n|  :param originalresponse:\n|      When this HTTPResponse wrapper is generated from an :class:`http.client.HTTPResponse`\n|      object, it's convenient to include the original for debug purposes. It's\n|      otherwise unused.\n|\n|  :param retries:\n|      The retries contains the last :class:`~urllib3.util.retry.Retry` that\n|      was used during the request.\n|\n|  :param enforcecontentlength:\n|      Enforce content length checking. Body returned by server must match\n|      value of Content-Length header, if present. Otherwise, raise error.\n|\n|  Method resolution order:\n|      HTTPResponse\n|      io.IOBase\n|      io.IOBase\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  init(self, body='', headers=None, status=0, version=0, reason=None, strict=0, preloadcontent=True, decodecontent=True, originalresponse=None, pool=None, connection=None, msg=None, retries=None, enforcecontentlength=False, requestmethod=None, requesturl=None, autoclose=True)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  iter(self)\n|      Implement iter(self).\n|\n|  close(self)\n|      Flush and close the IO object.\n|\n|      This method has no effect if the file is already closed.\n|\n|  drainconn(self)\n|      Read and discard any remaining HTTP response data in the response connection.\n|\n|      Unread data in the HTTPResponse connection blocks the connection from being released back to the pool.\n|\n|  fileno(self)\n|      Returns underlying file descriptor if one exists.\n|\n|      OSError is raised if the IO object does not use a file descriptor.\n|\n|  flush(self)\n|      Flush write buffers, if applicable.\n|\n|      This is not implemented for read-only and non-blocking streams.\n|\n|  getredirectlocation(self)\n|      Should we redirect and where to?\n|\n|      :returns: Truthy redirect location string if we got a redirect status\n|          code and valid location. ``None`` if redirect status and no\n|          location. ``False`` if not a redirect status code.\n|\n|  getheader(self, name, default=None)\n|\n|  getheaders(self)\n|      # Backwards-compatibility methods for http.client.HTTPResponse\n|\n|  geturl(self)\n|      Returns the URL that was the source of this response.\n|      If the request that generated this response redirected, this method\n|      will return the final redirect location.\n|\n|  info(self)\n|      # Backwards compatibility for http.cookiejar\n|\n|  isclosed(self)\n|\n|  read(self, amt=None, decodecontent=None, cachecontent=False)\n|      Similar to :meth:`http.client.HTTPResponse.read`, but with two additional\n|      parameters: ``decodecontent`` and ``cachecontent``.\n|\n|      :param amt:\n|          How much of the content to read. If specified, caching is skipped\n|          because it doesn't make sense to cache partial content as the full\n|          response.\n|\n|      :param decodecontent:\n|          If True, will attempt to decode the body based on the\n|          'content-encoding' header.\n|\n|      :param cachecontent:\n|          If True, will save the returned data such that the same result is\n|          returned despite of the state of the underlying file object. This\n|          is useful if you want the ``.data`` property to continue working\n|          after having ``.read()`` the file object. (Overridden if ``amt`` is\n|          set.)\n|\n|  readchunked(self, amt=None, decodecontent=None)\n|      Similar to :meth:`HTTPResponse.read`, but with an additional\n|      parameter: ``decodecontent``.\n|\n|      :param amt:\n|          How much of the content to read. If specified, caching is skipped\n|          because it doesn't make sense to cache partial content as the full\n|          response.\n|\n|      :param decodecontent:\n|          If True, will attempt to decode the body based on the\n|          'content-encoding' header.\n|\n|  readable(self)\n|      Return whether object was opened for reading.\n|\n|      If False, read() will raise OSError.\n|\n|  readinto(self, b)\n|\n|  releaseconn(self)\n|\n|  stream(self, amt=65536, decodecontent=None)\n|      A generator wrapper for the read() method. A call will block until\n|      ``amt`` bytes have been read from the connection or until the\n|      connection is closed.\n|\n|      :param amt:\n|          How much of the content to read. The generator will return up to\n|          much data per iteration, but may return less. This is particularly\n|          likely when using compressed data. However, the empty string will\n|          never be returned.\n|\n|      :param decodecontent:\n|          If True, will attempt to decode the body based on the\n|          'content-encoding' header.\n|\n|  supportschunkedreads(self)\n|      Checks if the underlying file-like object looks like a\n|      :class:`http.client.HTTPResponse` object. We do this by testing for\n|      the fp attribute. If it is present we assume it returns raw chunks as\n|      processed by readchunked().\n|\n|  tell(self)\n|      Obtain the number of bytes pulled over the wire so far. May differ from\n|      the amount of content returned by :meth:``urllib3.response.HTTPResponse.read``\n|      if bytes are encoded on the wire (e.g, compressed).\n|\n|  ----------------------------------------------------------------------\n|  Class methods defined here:\n|\n|  fromhttplib(r, responsekw) from abc.ABCMeta\n|      Given an :class:`http.client.HTTPResponse` instance ``r``, return a\n|      corresponding :class:`urllib3.response.HTTPResponse` object.\n|\n|      Remaining parameters are passed to the HTTPResponse constructor, along\n|      with ``originalresponse=r``.\n|\n|  ----------------------------------------------------------------------\n|  Readonly properties defined here:\n|\n|  closed\n|\n|  connection\n|\n|  data\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  CONTENTDECODERS = ['gzip', 'deflate']\n|\n|  DECODERERRORCLASSES = (<class 'OSError'>, <class 'zlib.error'>)\n|\n|  REDIRECTSTATUSES = [301, 302, 303, 307, 308]\n|\n|  abstractmethods = frozenset()\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from io.IOBase:\n|\n|  del(...)\n|\n|  enter(...)\n|\n|  exit(...)\n|\n|  next(self, /)\n|      Implement next(self).\n|\n|  isatty(self, /)\n|      Return whether this is an 'interactive' stream.\n|\n|      Return False if it can't be determined.\n|\n|  readline(self, size=-1, /)\n|      Read and return a line from the stream.\n|\n|      If size is specified, at most size bytes will be read.\n|\n|      The line terminator is always b'\\n' for binary files; for text\n|      files, the newlines argument to open can be used to select the line\n|      terminator(s) recognized.\n|\n|  readlines(self, hint=-1, /)\n|      Return a list of lines from the stream.\n|\n|      hint can be specified to control the number of lines read: no more\n|      lines will be read if the total size (in bytes/characters) of all\n|      lines so far exceeds hint.\n|\n|  seek(...)\n|      Change stream position.\n|\n|      Change the stream position to the given byte offset. The offset is\n|      interpreted relative to the position indicated by whence.  Values\n|      for whence are:\n|\n|      * 0 -- start of stream (the default); offset should be zero or positive\n|      * 1 -- current stream position; offset may be negative\n|      * 2 -- end of stream; offset is usually negative\n|\n|      Return the new absolute position.\n|\n|  seekable(self, /)\n|      Return whether object supports random access.\n|\n|      If False, seek(), tell() and truncate() will raise OSError.\n|      This method may need to do a test seek().\n|\n|  truncate(...)\n|      Truncate file to size bytes.\n|\n|      File pointer is left unchanged.  Size defaults to the current IO\n|      position as reported by tell().  Returns the new size.\n|\n|  writable(self, /)\n|      Return whether object was opened for writing.\n|\n|      If False, write() will raise OSError.\n|\n|  writelines(self, lines, /)\n|      Write a list of lines to stream.\n|\n|      Line separators are not added, so it is usual for each of the\n|      lines provided to have a line separator at the end.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from io.IOBase:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from io.IOBase:\n|\n|  dict\n\n#### class HTTPSConnectionPool\n\n|  HTTPSConnectionPool(host, port=None, strict=False, timeout=<object object at 0x7efc6e05cb30>, maxsize=1, block=False, headers=None, retries=None, proxy=None, proxyheaders=None, keyfile=None, certfile=None, certreqs='CERTREQUIRED', keypassword=None, cacerts='/etc/ssl/certs/ca-certificates.crt', sslversion=None, asserthostname=None, assertfingerprint=None, cacertdir=None, connkw)\n|\n|  Same as :class:`.HTTPConnectionPool`, but HTTPS.\n|\n|  :class:`.HTTPSConnection` uses one of ``assertfingerprint``,\n|  ``asserthostname`` and ``host`` in this order to verify connections.\n|  If ``asserthostname`` is False, no verification is done.\n|\n|  The ``keyfile``, ``certfile``, ``certreqs``, ``cacerts``,\n|  ``cacertdir``, ``sslversion``, ``keypassword`` are only used if :mod:`ssl`\n|  is available and are fed into :meth:`urllib3.util.sslwrapsocket` to upgrade\n|  the connection socket into an SSL socket.\n|\n|  On Debian, SSL certificate validation is required by default\n|\n|  Method resolution order:\n|      HTTPSConnectionPool\n|      HTTPConnectionPool\n|      ConnectionPool\n|      urllib3.request.RequestMethods\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  init(self, host, port=None, strict=False, timeout=<object object at 0x7efc6e05cb30>, maxsize=1, block=False, headers=None, retries=None, proxy=None, proxyheaders=None, keyfile=None, certfile=None, certreqs='CERTREQUIRED', keypassword=None, cacerts='/etc/ssl/certs/ca-certificates.crt', sslversion=None, asserthostname=None, assertfingerprint=None, cacertdir=None, connkw)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  ConnectionCls = <class 'urllib3.connection.HTTPSConnection'>\n|      Many of the parameters to this constructor are passed to the underlying SSL\n|      socket by means of :py:func:`urllib3.util.sslwrapsocket`.\n|\n|\n|  scheme = 'https'\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from HTTPConnectionPool:\n|\n|  close(self)\n|      Close all pooled connections and disable the pool.\n|\n|  issamehost(self, url)\n|      Check if the given ``url`` is a member of the same host as this\n|      connection pool.\n|\n|  urlopen(self, method, url, body=None, headers=None, retries=None, redirect=True, assertsamehost=True, timeout=<object object at 0x7efc6e05ce00>, pooltimeout=None, releaseconn=None, chunked=False, bodypos=None, responsekw)\n|      Get a connection from the pool and perform an HTTP request. This is the\n|      lowest level call for making a request, so you'll need to specify all\n|      the raw details.\n|\n|      .. note::\n|\n|         More commonly, it's appropriate to use a convenience method provided\n|         by :class:`.RequestMethods`, such as :meth:`request`.\n|\n|      .. note::\n|\n|         `releaseconn` will only behave as expected if\n|         `preloadcontent=False` because we want to make\n|         `preloadcontent=False` the default behaviour someday soon without\n|         breaking backwards compatibility.\n|\n|      :param method:\n|          HTTP request method (such as GET, POST, PUT, etc.)\n|\n|      :param url:\n|          The URL to perform the request on.\n|\n|      :param body:\n|          Data to send in the request body, either :class:`str`, :class:`bytes`,\n|          an iterable of :class:`str`/:class:`bytes`, or a file-like object.\n|\n|      :param headers:\n|          Dictionary of custom headers to send, such as User-Agent,\n|          If-None-Match, etc. If None, pool headers are used. If provided,\n|          these headers completely replace any pool-specific headers.\n|\n|      :param retries:\n|          Configure the number of retries to allow before raising a\n|          :class:`~urllib3.exceptions.MaxRetryError` exception.\n|\n|          Pass ``None`` to retry until you receive a response. Pass a\n|          :class:`~urllib3.util.retry.Retry` object for fine-grained control\n|          over different types of retries.\n|          Pass an integer number to retry connection errors that many times,\n|          but no other types of errors. Pass zero to never retry.\n|\n|          If ``False``, then retries are disabled and any exception is raised\n|          immediately. Also, instead of raising a MaxRetryError on redirects,\n|          the redirect response will be returned.\n|\n|      :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int.\n|\n|      :param redirect:\n|          If True, automatically handle redirects (status codes 301, 302,\n|          303, 307, 308). Each redirect counts as a retry. Disabling retries\n|          will disable redirect, too.\n|\n|      :param assertsamehost:\n|          If ``True``, will make sure that the host of the pool requests is\n|          consistent else will raise HostChangedError. When ``False``, you can\n|          use the pool on an HTTP proxy and request foreign hosts.\n|\n|      :param timeout:\n|          If specified, overrides the default timeout for this one\n|          request. It may be a float (in seconds) or an instance of\n|          :class:`urllib3.util.Timeout`.\n|\n|      :param pooltimeout:\n|          If set and the pool is set to block=True, then this method will\n|          block for ``pooltimeout`` seconds and raise EmptyPoolError if no\n|          connection is available within the time period.\n|\n|      :param releaseconn:\n|          If False, then the urlopen call will not release the connection\n|          back into the pool once a response is received (but will release if\n|          you read the entire contents of the response such as when\n|          `preloadcontent=True`). This is useful if you're not preloading\n|          the response's content immediately. You will need to call\n|          ``r.releaseconn()`` on the response ``r`` to return the connection\n|          back into the pool. If None, it takes the value of\n|          ``responsekw.get('preloadcontent', True)``.\n|\n|      :param chunked:\n|          If True, urllib3 will send the body using chunked transfer\n|          encoding. Otherwise, urllib3 will send the body using the standard\n|          content-length form. Defaults to False.\n|\n|      :param int bodypos:\n|          Position to seek to in file-like body in the event of a retry or\n|          redirect. Typically this won't need to be set because urllib3 will\n|          auto-populate the value when needed.\n|\n|      :param \\responsekw:\n|          Additional parameters are passed to\n|          :meth:`urllib3.response.HTTPResponse.fromhttplib`\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes inherited from HTTPConnectionPool:\n|\n|  ResponseCls = <class 'urllib3.response.HTTPResponse'>\n|      HTTP Response container.\n|\n|      Backwards-compatible with :class:`http.client.HTTPResponse` but the response ``body`` is\n|      loaded and decoded on-demand when the ``data`` property is accessed.  This\n|      class is also compatible with the Python standard library's :mod:`io`\n|      module, and can hence be treated as a readable object in the context of that\n|      framework.\n|\n|      Extra parameters for behaviour not present in :class:`http.client.HTTPResponse`:\n|\n|      :param preloadcontent:\n|          If True, the response's body will be preloaded during construction.\n|\n|      :param decodecontent:\n|          If True, will attempt to decode the body based on the\n|          'content-encoding' header.\n|\n|      :param originalresponse:\n|          When this HTTPResponse wrapper is generated from an :class:`http.client.HTTPResponse`\n|          object, it's convenient to include the original for debug purposes. It's\n|          otherwise unused.\n|\n|      :param retries:\n|          The retries contains the last :class:`~urllib3.util.retry.Retry` that\n|          was used during the request.\n|\n|      :param enforcecontentlength:\n|          Enforce content length checking. Body returned by server must match\n|          value of Content-Length header, if present. Otherwise, raise error.\n|\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from ConnectionPool:\n|\n|  enter(self)\n|\n|  exit(self, exctype, excval, exctb)\n|\n|  str(self)\n|      Return str(self).\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from ConnectionPool:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes inherited from ConnectionPool:\n|\n|  QueueCls = <class 'urllib3.util.queue.LifoQueue'>\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from urllib3.request.RequestMethods:\n|\n|  request(self, method, url, fields=None, headers=None, urlopenkw)\n|      Make a request using :meth:`urlopen` with the appropriate encoding of\n|      ``fields`` based on the ``method`` used.\n|\n|      This is a convenience method that requires the least amount of manual\n|      effort. It can be used in most situations, while still having the\n|      option to drop down to more specific methods when necessary, such as\n|      :meth:`requestencodeurl`, :meth:`requestencodebody`,\n|      or even the lowest level :meth:`urlopen`.\n|\n|  requestencodebody(self, method, url, fields=None, headers=None, encodemultipart=True, multipartboundary=None, urlopenkw)\n|      Make a request using :meth:`urlopen` with the ``fields`` encoded in\n|      the body. This is useful for request methods like POST, PUT, PATCH, etc.\n|\n|      When ``encodemultipart=True`` (default), then\n|      :func:`urllib3.encodemultipartformdata` is used to encode\n|      the payload with the appropriate content type. Otherwise\n|      :func:`urllib.parse.urlencode` is used with the\n|      'application/x-www-form-urlencoded' content type.\n|\n|      Multipart encoding must be used when posting files, and it's reasonably\n|      safe to use it in other times too. However, it may break request\n|      signing, such as with OAuth.\n|\n|      Supports an optional ``fields`` parameter of key/value strings AND\n|      key/filetuple. A filetuple is a (filename, data, MIME type) tuple where\n|      the MIME type is optional. For example::\n|\n|          fields = {\n|              'foo': 'bar',\n|              'fakefile': ('foofile.txt', 'contents of foofile'),\n|              'realfile': ('barfile.txt', open('realfile').read()),\n|              'typedfile': ('bazfile.bin', open('bazfile').read(),\n|                            'image/jpeg'),\n|              'nonamefile': 'contents of nonamefile field',\n|          }\n|\n|      When uploading a file, providing a filename (the first parameter of the\n|      tuple) is optional but recommended to best mimic behavior of browsers.\n|\n|      Note that if ``headers`` are supplied, the 'Content-Type' header will\n|      be overwritten because it depends on the dynamic random boundary string\n|      which is used to compose the body of the request. The random boundary\n|      string can be explicitly set with the ``multipartboundary`` parameter.\n|\n|  requestencodeurl(self, method, url, fields=None, headers=None, urlopenkw)\n|      Make a request using :meth:`urlopen` with the ``fields`` encoded in\n|      the url. This is useful for request methods like GET, HEAD, DELETE, etc.\n\n#### class PoolManager\n\n|  PoolManager(numpools=10, headers=None, connectionpoolkw)\n|\n|  Allows for arbitrary requests while transparently keeping track of\n|  necessary connection pools for you.\n|\n|  :param numpools:\n|      Number of connection pools to cache before discarding the least\n|      recently used pool.\n|\n|  :param headers:\n|      Headers to include with all requests, unless other headers are given\n|      explicitly.\n|\n|  :param \\connectionpoolkw:\n|      Additional parameters are used to create fresh\n|      :class:`urllib3.connectionpool.ConnectionPool` instances.\n|\n|  Example::\n|\n|      >>> manager = PoolManager(numpools=2)\n|      >>> r = manager.request('GET', 'http://google.com/')\n|      >>> r = manager.request('GET', 'http://google.com/mail')\n|      >>> r = manager.request('GET', 'http://yahoo.com/')\n|      >>> len(manager.pools)\n|      2\n|\n|  Method resolution order:\n|      PoolManager\n|      urllib3.request.RequestMethods\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  enter(self)\n|\n|  exit(self, exctype, excval, exctb)\n|\n|  init(self, numpools=10, headers=None, connectionpoolkw)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  clear(self)\n|      Empty our store of pools and direct them all to close.\n|\n|      This will not affect in-flight connections, but they will not be\n|      re-used after completion.\n|\n|  connectionfromcontext(self, requestcontext)\n|      Get a :class:`urllib3.connectionpool.ConnectionPool` based on the request context.\n|\n|      ``requestcontext`` must at least contain the ``scheme`` key and its\n|      value must be a key in ``keyfnbyscheme`` instance variable.\n|\n|  connectionfromhost(self, host, port=None, scheme='http', poolkwargs=None)\n|      Get a :class:`urllib3.connectionpool.ConnectionPool` based on the host, port, and scheme.\n|\n|      If ``port`` isn't given, it will be derived from the ``scheme`` using\n|      ``urllib3.connectionpool.portbyscheme``. If ``poolkwargs`` is\n|      provided, it is merged with the instance's ``connectionpoolkw``\n|      variable and used to create the new connection pool, if one is\n|      needed.\n|\n|  connectionfrompoolkey(self, poolkey, requestcontext=None)\n|      Get a :class:`urllib3.connectionpool.ConnectionPool` based on the provided pool key.\n|\n|      ``poolkey`` should be a namedtuple that only contains immutable\n|      objects. At a minimum it must have the ``scheme``, ``host``, and\n|      ``port`` fields.\n|\n|  connectionfromurl(self, url, poolkwargs=None)\n|      Similar to :func:`urllib3.connectionpool.connectionfromurl`.\n|\n|      If ``poolkwargs`` is not provided and a new pool needs to be\n|      constructed, ``self.connectionpoolkw`` is used to initialize\n|      the :class:`urllib3.connectionpool.ConnectionPool`. If ``poolkwargs``\n|      is provided, it is used instead. Note that if a new pool does not\n|      need to be created for the request, the provided ``poolkwargs`` are\n|      not used.\n|\n|  urlopen(self, method, url, redirect=True, kw)\n|      Same as :meth:`urllib3.HTTPConnectionPool.urlopen`\n|      with custom cross-host redirect logic and only sends the request-uri\n|      portion of the ``url``.\n|\n|      The given ``url`` parameter must be absolute, such that an appropriate\n|      :class:`urllib3.connectionpool.ConnectionPool` can be chosen for it.\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  proxy = None\n|\n|  proxyconfig = None\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from urllib3.request.RequestMethods:\n|\n|  request(self, method, url, fields=None, headers=None, urlopenkw)\n|      Make a request using :meth:`urlopen` with the appropriate encoding of\n|      ``fields`` based on the ``method`` used.\n|\n|      This is a convenience method that requires the least amount of manual\n|      effort. It can be used in most situations, while still having the\n|      option to drop down to more specific methods when necessary, such as\n|      :meth:`requestencodeurl`, :meth:`requestencodebody`,\n|      or even the lowest level :meth:`urlopen`.\n|\n|  requestencodebody(self, method, url, fields=None, headers=None, encodemultipart=True, multipartboundary=None, urlopenkw)\n|      Make a request using :meth:`urlopen` with the ``fields`` encoded in\n|      the body. This is useful for request methods like POST, PUT, PATCH, etc.\n|\n|      When ``encodemultipart=True`` (default), then\n|      :func:`urllib3.encodemultipartformdata` is used to encode\n|      the payload with the appropriate content type. Otherwise\n|      :func:`urllib.parse.urlencode` is used with the\n|      'application/x-www-form-urlencoded' content type.\n|\n|      Multipart encoding must be used when posting files, and it's reasonably\n|      safe to use it in other times too. However, it may break request\n|      signing, such as with OAuth.\n|\n|      Supports an optional ``fields`` parameter of key/value strings AND\n|      key/filetuple. A filetuple is a (filename, data, MIME type) tuple where\n|      the MIME type is optional. For example::\n|\n|          fields = {\n|              'foo': 'bar',\n|              'fakefile': ('foofile.txt', 'contents of foofile'),\n|              'realfile': ('barfile.txt', open('realfile').read()),\n|              'typedfile': ('bazfile.bin', open('bazfile').read(),\n|                            'image/jpeg'),\n|              'nonamefile': 'contents of nonamefile field',\n|          }\n|\n|      When uploading a file, providing a filename (the first parameter of the\n|      tuple) is optional but recommended to best mimic behavior of browsers.\n|\n|      Note that if ``headers`` are supplied, the 'Content-Type' header will\n|      be overwritten because it depends on the dynamic random boundary string\n|      which is used to compose the body of the request. The random boundary\n|      string can be explicitly set with the ``multipartboundary`` parameter.\n|\n|  requestencodeurl(self, method, url, fields=None, headers=None, urlopenkw)\n|      Make a request using :meth:`urlopen` with the ``fields`` encoded in\n|      the url. This is useful for request methods like GET, HEAD, DELETE, etc.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from urllib3.request.RequestMethods:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n\n#### class ProxyManager\n\n|  ProxyManager(proxyurl, numpools=10, headers=None, proxyheaders=None, proxysslcontext=None, useforwardingforhttps=False, connectionpoolkw)\n|\n|  Behaves just like :class:`PoolManager`, but sends all requests through\n|  the defined proxy, using the CONNECT method for HTTPS URLs.\n|\n|  :param proxyurl:\n|      The URL of the proxy to be used.\n|\n|  :param proxyheaders:\n|      A dictionary containing headers that will be sent to the proxy. In case\n|      of HTTP they are being sent with each request, while in the\n|      HTTPS/CONNECT case they are sent only once. Could be used for proxy\n|      authentication.\n|\n|  :param proxysslcontext:\n|      The proxy SSL context is used to establish the TLS connection to the\n|      proxy when using HTTPS proxies.\n|\n|  :param useforwardingforhttps:\n|      (Defaults to False) If set to True will forward requests to the HTTPS\n|      proxy to be made on behalf of the client instead of creating a TLS\n|      tunnel via the CONNECT method. Enabling this flag means that request\n|      and response headers and content will be visible from the HTTPS proxy\n|      whereas tunneling keeps request and response headers and content\n|      private.  IP address, target hostname, SNI, and port are always visible\n|      to an HTTPS proxy even when this flag is disabled.\n|\n|  Example:\n|      >>> proxy = urllib3.ProxyManager('http://localhost:3128/')\n|      >>> r1 = proxy.request('GET', 'http://google.com/')\n|      >>> r2 = proxy.request('GET', 'http://httpbin.org/')\n|      >>> len(proxy.pools)\n|      1\n|      >>> r3 = proxy.request('GET', 'https://httpbin.org/')\n|      >>> r4 = proxy.request('GET', 'https://twitter.com/')\n|      >>> len(proxy.pools)\n|      3\n|\n|  Method resolution order:\n|      ProxyManager\n|      PoolManager\n|      urllib3.request.RequestMethods\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  init(self, proxyurl, numpools=10, headers=None, proxyheaders=None, proxysslcontext=None, useforwardingforhttps=False, connectionpoolkw)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  connectionfromhost(self, host, port=None, scheme='http', poolkwargs=None)\n|      Get a :class:`urllib3.connectionpool.ConnectionPool` based on the host, port, and scheme.\n|\n|      If ``port`` isn't given, it will be derived from the ``scheme`` using\n|      ``urllib3.connectionpool.portbyscheme``. If ``poolkwargs`` is\n|      provided, it is merged with the instance's ``connectionpoolkw``\n|      variable and used to create the new connection pool, if one is\n|      needed.\n|\n|  urlopen(self, method, url, redirect=True, kw)\n|      Same as HTTP(S)ConnectionPool.urlopen, ``url`` must be absolute.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from PoolManager:\n|\n|  enter(self)\n|\n|  exit(self, exctype, excval, exctb)\n|\n|  clear(self)\n|      Empty our store of pools and direct them all to close.\n|\n|      This will not affect in-flight connections, but they will not be\n|      re-used after completion.\n|\n|  connectionfromcontext(self, requestcontext)\n|      Get a :class:`urllib3.connectionpool.ConnectionPool` based on the request context.\n|\n|      ``requestcontext`` must at least contain the ``scheme`` key and its\n|      value must be a key in ``keyfnbyscheme`` instance variable.\n|\n|  connectionfrompoolkey(self, poolkey, requestcontext=None)\n|      Get a :class:`urllib3.connectionpool.ConnectionPool` based on the provided pool key.\n|\n|      ``poolkey`` should be a namedtuple that only contains immutable\n|      objects. At a minimum it must have the ``scheme``, ``host``, and\n|      ``port`` fields.\n|\n|  connectionfromurl(self, url, poolkwargs=None)\n|      Similar to :func:`urllib3.connectionpool.connectionfromurl`.\n|\n|      If ``poolkwargs`` is not provided and a new pool needs to be\n|      constructed, ``self.connectionpoolkw`` is used to initialize\n|      the :class:`urllib3.connectionpool.ConnectionPool`. If ``poolkwargs``\n|      is provided, it is used instead. Note that if a new pool does not\n|      need to be created for the request, the provided ``poolkwargs`` are\n|      not used.\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes inherited from PoolManager:\n|\n|  proxy = None\n|\n|  proxyconfig = None\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from urllib3.request.RequestMethods:\n|\n|  request(self, method, url, fields=None, headers=None, urlopenkw)\n|      Make a request using :meth:`urlopen` with the appropriate encoding of\n|      ``fields`` based on the ``method`` used.\n|\n|      This is a convenience method that requires the least amount of manual\n|      effort. It can be used in most situations, while still having the\n|      option to drop down to more specific methods when necessary, such as\n|      :meth:`requestencodeurl`, :meth:`requestencodebody`,\n|      or even the lowest level :meth:`urlopen`.\n|\n|  requestencodebody(self, method, url, fields=None, headers=None, encodemultipart=True, multipartboundary=None, urlopenkw)\n|      Make a request using :meth:`urlopen` with the ``fields`` encoded in\n|      the body. This is useful for request methods like POST, PUT, PATCH, etc.\n|\n|      When ``encodemultipart=True`` (default), then\n|      :func:`urllib3.encodemultipartformdata` is used to encode\n|      the payload with the appropriate content type. Otherwise\n|      :func:`urllib.parse.urlencode` is used with the\n|      'application/x-www-form-urlencoded' content type.\n|\n|      Multipart encoding must be used when posting files, and it's reasonably\n|      safe to use it in other times too. However, it may break request\n|      signing, such as with OAuth.\n|\n|      Supports an optional ``fields`` parameter of key/value strings AND\n|      key/filetuple. A filetuple is a (filename, data, MIME type) tuple where\n|      the MIME type is optional. For example::\n|\n|          fields = {\n|              'foo': 'bar',\n|              'fakefile': ('foofile.txt', 'contents of foofile'),\n|              'realfile': ('barfile.txt', open('realfile').read()),\n|              'typedfile': ('bazfile.bin', open('bazfile').read(),\n|                            'image/jpeg'),\n|              'nonamefile': 'contents of nonamefile field',\n|          }\n|\n|      When uploading a file, providing a filename (the first parameter of the\n|      tuple) is optional but recommended to best mimic behavior of browsers.\n|\n|      Note that if ``headers`` are supplied, the 'Content-Type' header will\n|      be overwritten because it depends on the dynamic random boundary string\n|      which is used to compose the body of the request. The random boundary\n|      string can be explicitly set with the ``multipartboundary`` parameter.\n|\n|  requestencodeurl(self, method, url, fields=None, headers=None, urlopenkw)\n|      Make a request using :meth:`urlopen` with the ``fields`` encoded in\n|      the url. This is useful for request methods like GET, HEAD, DELETE, etc.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from urllib3.request.RequestMethods:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n\n#### class Retry\n\n|  Retry(total=10, connect=None, read=None, redirect=None, status=None, other=None, allowedmethods=<object object at 0x7efc6e05cd20>, statusforcelist=None, backofffactor=0, raiseonredirect=True, raiseonstatus=True, history=None, respectretryafterheader=True, removeheadersonredirect=<object object at 0x7efc6e05cd20>, methodwhitelist=<object object at 0x7efc6e05cd20>)\n|\n|  Retry configuration.\n|\n|  Each retry attempt will create a new Retry object with updated values, so\n|  they can be safely reused.\n|\n|  Retries can be defined as a default for a pool::\n|\n|      retries = Retry(connect=5, read=2, redirect=5)\n|      http = PoolManager(retries=retries)\n|      response = http.request('GET', 'http://example.com/')\n|\n|  Or per-request (which overrides the default for the pool)::\n|\n|      response = http.request('GET', 'http://example.com/', retries=Retry(10))\n|\n|  Retries can be disabled by passing ``False``::\n|\n|      response = http.request('GET', 'http://example.com/', retries=False)\n|\n|  Errors will be wrapped in :class:`~urllib3.exceptions.MaxRetryError` unless\n|  retries are disabled, in which case the causing exception will be raised.\n|\n|  :param int total:\n|      Total number of retries to allow. Takes precedence over other counts.\n|\n|      Set to ``None`` to remove this constraint and fall back on other\n|      counts.\n|\n|      Set to ``0`` to fail on the first retry.\n|\n|      Set to ``False`` to disable and imply ``raiseonredirect=False``.\n|\n|  :param int connect:\n|      How many connection-related errors to retry on.\n|\n|      These are errors raised before the request is sent to the remote server,\n|      which we assume has not triggered the server to process the request.\n|\n|      Set to ``0`` to fail on the first retry of this type.\n|\n|  :param int read:\n|      How many times to retry on read errors.\n|\n|      These errors are raised after the request was sent to the server, so the\n|      request may have side-effects.\n|\n|      Set to ``0`` to fail on the first retry of this type.\n|\n|  :param int redirect:\n|      How many redirects to perform. Limit this to avoid infinite redirect\n|      loops.\n|\n|      A redirect is a HTTP response with a status code 301, 302, 303, 307 or\n|      308.\n|\n|      Set to ``0`` to fail on the first retry of this type.\n|\n|      Set to ``False`` to disable and imply ``raiseonredirect=False``.\n|\n|  :param int status:\n|      How many times to retry on bad status codes.\n|\n|      These are retries made on responses, where status code matches\n|      ``statusforcelist``.\n|\n|      Set to ``0`` to fail on the first retry of this type.\n|\n|  :param int other:\n|      How many times to retry on other errors.\n|\n|      Other errors are errors that are not connect, read, redirect or status errors.\n|      These errors might be raised after the request was sent to the server, so the\n|      request might have side-effects.\n|\n|      Set to ``0`` to fail on the first retry of this type.\n|\n|      If ``total`` is not set, it's a good idea to set this to 0 to account\n|      for unexpected edge cases and avoid infinite retry loops.\n|\n|  :param iterable allowedmethods:\n|      Set of uppercased HTTP method verbs that we should retry on.\n|\n|      By default, we only retry on methods which are considered to be\n|      idempotent (multiple requests with the same parameters end with the\n|      same state). See :attr:`Retry.DEFAULTALLOWEDMETHODS`.\n|\n|      Set to a ``False`` value to retry on any verb.\n|\n|      .. warning::\n|\n|          Previously this parameter was named ``methodwhitelist``, that\n|          usage is deprecated in v1.26.0 and will be removed in v2.0.\n|\n|  :param iterable statusforcelist:\n|      A set of integer HTTP status codes that we should force a retry on.\n|      A retry is initiated if the request method is in ``allowedmethods``\n|      and the response status code is in ``statusforcelist``.\n|\n|      By default, this is disabled with ``None``.\n|\n|  :param float backofffactor:\n|      A backoff factor to apply between attempts after the second try\n|      (most errors are resolved immediately by a second try without a\n|      delay). urllib3 will sleep for::\n|\n|          {backoff factor} * (2  ({number of total retries} - 1))\n|\n|      seconds. If the backofffactor is 0.1, then :func:`.sleep` will sleep\n|      for [0.0s, 0.2s, 0.4s, ...] between retries. It will never be longer\n|      than :attr:`Retry.BACKOFFMAX`.\n|\n|      By default, backoff is disabled (set to 0).\n|\n|  :param bool raiseonredirect: Whether, if the number of redirects is\n|      exhausted, to raise a MaxRetryError, or to return a response with a\n|      response code in the 3xx range.\n|\n|  :param bool raiseonstatus: Similar meaning to ``raiseonredirect``:\n|      whether we should raise an exception, or return a response,\n|      if status falls in ``statusforcelist`` range and retries have\n|      been exhausted.\n|\n|  :param tuple history: The history of the request encountered during\n|      each call to :meth:`~Retry.increment`. The list is in the order\n|      the requests occurred. Each list item is of class :class:`RequestHistory`.\n|\n|  :param bool respectretryafterheader:\n|      Whether to respect Retry-After header on status codes defined as\n|      :attr:`Retry.RETRYAFTERSTATUSCODES` or not.\n|\n|  :param iterable removeheadersonredirect:\n|      Sequence of headers to remove from the request when a response\n|      indicating a redirect is returned before firing off the redirected\n|      request.\n|\n|  Methods defined here:\n|\n|  getattr(self, item)\n|\n|  init(self, total=10, connect=None, read=None, redirect=None, status=None, other=None, allowedmethods=<object object at 0x7efc6e05cd20>, statusforcelist=None, backofffactor=0, raiseonredirect=True, raiseonstatus=True, history=None, respectretryafterheader=True, removeheadersonredirect=<object object at 0x7efc6e05cd20>, methodwhitelist=<object object at 0x7efc6e05cd20>)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  repr(self)\n|      Return repr(self).\n|\n|  getbackofftime(self)\n|      Formula for computing the current backoff\n|\n|      :rtype: float\n|\n|  getretryafter(self, response)\n|      Get the value of Retry-After in seconds.\n|\n|  increment(self, method=None, url=None, response=None, error=None, pool=None, stacktrace=None)\n|      Return a new Retry object with incremented retry counters.\n|\n|      :param response: A response object, or None, if the server did not\n|          return a response.\n|      :type response: :class:`~urllib3.response.HTTPResponse`\n|      :param Exception error: An error encountered during the request, or\n|          None if the response was received successfully.\n|\n|      :return: A new ``Retry`` object.\n|\n|  isexhausted(self)\n|      Are we out of retries?\n|\n|  isretry(self, method, statuscode, hasretryafter=False)\n|      Is this method/status code retryable? (Based on allowlists and control\n|      variables such as the number of total retries to allow, whether to\n|      respect the Retry-After header, whether this header is present, and\n|      whether the returned status code is on the list of status codes to\n|      be retried upon on the presence of the aforementioned header)\n|\n|  new(self, kw)\n|\n|  parseretryafter(self, retryafter)\n|\n|  sleep(self, response=None)\n|      Sleep between retry attempts.\n|\n|      This method will respect a server's ``Retry-After`` response header\n|      and sleep the duration of the time requested. If that is not present, it\n|      will use an exponential backoff. By default, the backoff factor is 0 and\n|      this method will return immediately.\n|\n|  sleepforretry(self, response=None)\n|\n|  ----------------------------------------------------------------------\n|  Class methods defined here:\n|\n|  fromint(retries, redirect=True, default=None) from urllib3.util.retry.RetryMeta\n|      Backwards-compatibility for the old retries format.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  BACKOFFMAX = 120\n|\n|  DEFAULT = Retry(total=3, connect=None, read=None, redirect=None, statu...\n|\n|  DEFAULTALLOWEDMETHODS = frozenset({'DELETE', 'GET', 'HEAD', 'OPTIONS...\n|\n|  DEFAULTREMOVEHEADERSONREDIRECT = frozenset({'Authorization', 'Cook...\n|\n|  RETRYAFTERSTATUSCODES = frozenset({413, 429, 503})\n\n#### class Timeout\n\n|  Timeout(total=None, connect=<object object at 0x7efc6e05d190>, read=<object object at 0x7efc6e05d190>)\n|\n|  Timeout configuration.\n|\n|  Timeouts can be defined as a default for a pool:\n|\n|  .. code-block:: python\n|\n|     timeout = Timeout(connect=2.0, read=7.0)\n|     http = PoolManager(timeout=timeout)\n|     response = http.request('GET', 'http://example.com/')\n|\n|  Or per-request (which overrides the default for the pool):\n|\n|  .. code-block:: python\n|\n|     response = http.request('GET', 'http://example.com/', timeout=Timeout(10))\n|\n|  Timeouts can be disabled by setting all the parameters to ``None``:\n|\n|  .. code-block:: python\n|\n|     notimeout = Timeout(connect=None, read=None)\n|     response = http.request('GET', 'http://example.com/, timeout=notimeout)\n|\n|\n|  :param total:\n|      This combines the connect and read timeouts into one; the read timeout\n|      will be set to the time leftover from the connect attempt. In the\n|      event that both a connect timeout and a total are specified, or a read\n|      timeout and a total are specified, the shorter timeout will be applied.\n|\n|      Defaults to None.\n|\n|  :type total: int, float, or None\n|\n|  :param connect:\n|      The maximum amount of time (in seconds) to wait for a connection\n|      attempt to a server to succeed. Omitting the parameter will default the\n|      connect timeout to the system default, probably `the global default\n|      timeout in socket.py\n|      <http://hg.python.org/cpython/file/603b4d593758/Lib/socket.py#l535>`.\n|      None will set an infinite timeout for connection attempts.\n|\n|  :type connect: int, float, or None\n|\n|  :param read:\n|      The maximum amount of time (in seconds) to wait between consecutive\n|      read operations for a response from the server. Omitting the parameter\n|      will default the read timeout to the system default, probably `the\n|      global default timeout in socket.py\n|      <http://hg.python.org/cpython/file/603b4d593758/Lib/socket.py#l535>`.\n|      None will set an infinite timeout.\n|\n|  :type read: int, float, or None\n|\n|  .. note::\n|\n|      Many factors can affect the total amount of time for urllib3 to return\n|      an HTTP response.\n|\n|      For example, Python's DNS resolver does not obey the timeout specified\n|      on the socket. Other factors that can affect total request time include\n|      high CPU load, high swap, the program running at a low priority level,\n|      or other behaviors.\n|\n|      In addition, the read and total timeouts only measure the time between\n|      read operations on the socket connecting the client and the server,\n|      not the total amount of time for the request to return a complete\n|      response. For most requests, the timeout is raised because the server\n|      has not sent the first byte in the specified time. This is not always\n|      the case; if a server streams one byte every fifteen seconds, a timeout\n|      of 20 seconds will not trigger, even though the request will take\n|      several minutes to complete.\n|\n|      If your goal is to cut off any request after a set amount of wall clock\n|      time, consider having a second \"watcher\" thread to cut off a slow\n|      request.\n|\n|  Methods defined here:\n|\n|  init(self, total=None, connect=<object object at 0x7efc6e05d190>, read=<object object at 0x7efc6e05d190>)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  repr(self)\n|      Return repr(self).\n|\n|  str = repr(self)\n|\n|  clone(self)\n|      Create a copy of the timeout object\n|\n|      Timeout properties are stored per-pool but each request needs a fresh\n|      Timeout object to ensure each one has its own start/stop configured.\n|\n|      :return: a copy of the timeout object\n|      :rtype: :class:`Timeout`\n|\n|  getconnectduration(self)\n|      Gets the time elapsed since the call to :meth:`startconnect`.\n|\n|      :return: Elapsed time in seconds.\n|      :rtype: float\n|      :raises urllib3.exceptions.TimeoutStateError: if you attempt\n|          to get duration for a timer that hasn't been started.\n|\n|  startconnect(self)\n|      Start the timeout clock, used during a connect() attempt\n|\n|      :raises urllib3.exceptions.TimeoutStateError: if you attempt\n|          to start a timer that has been started already.\n|\n|  ----------------------------------------------------------------------\n|  Class methods defined here:\n|\n|  fromfloat(timeout) from builtins.type\n|      Create a new Timeout from a legacy timeout value.\n|\n|      The timeout value used by httplib.py sets the same timeout on the\n|      connect(), and recv() socket requests. This creates a :class:`Timeout`\n|      object that sets the individual timeouts to the ``timeout`` value\n|      passed to this function.\n|\n|      :param timeout: The legacy timeout value.\n|      :type timeout: integer, float, sentinel default object, or None\n|      :return: Timeout object\n|      :rtype: :class:`Timeout`\n|\n|  ----------------------------------------------------------------------\n|  Readonly properties defined here:\n|\n|  connecttimeout\n|      Get the value to use when setting a connection timeout.\n|\n|      This will be a positive float or integer, the value None\n|      (never timeout), or the default system timeout.\n|\n|      :return: Connect timeout.\n|      :rtype: int, float, :attr:`Timeout.DEFAULTTIMEOUT` or None\n|\n|  readtimeout\n|      Get the value for the read timeout.\n|\n|      This assumes some time has elapsed in the connection timeout and\n|      computes the read timeout appropriately.\n|\n|      If self.total is set, the read timeout is dependent on the amount of\n|      time taken by the connect timeout. If the connection time has not been\n|      established, a :exc:`~urllib3.exceptions.TimeoutStateError` will be\n|      raised.\n|\n|      :return: Value to use for the read timeout.\n|      :rtype: int, float, :attr:`Timeout.DEFAULTTIMEOUT` or None\n|      :raises urllib3.exceptions.TimeoutStateError: If :meth:`startconnect`\n|          has not yet been called on this object.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  DEFAULTTIMEOUT = <object object>\n\n### FUNCTIONS\n\n#### add_stderr_logger\n\nHelper for quickly adding a StreamHandler to the logger. Useful for\ndebugging.\n\nReturns the handler after adding it.\n\n#### connection_from_url\n\nGiven a url, return an :class:`.ConnectionPool` instance of its host.\n\nThis is a shortcut for not having to parse out the scheme, host, and port\nof the url before creating an :class:`.ConnectionPool` instance.\n\n:param url:\nAbsolute URL string that must include the scheme. Port is optional.\n\n:param \\kw:\nPasses additional parameters to the constructor of the appropriate\n:class:`.ConnectionPool`. Useful for specifying things like\ntimeout, maxsize, headers, etc.\n\nExample::\n\n>>> conn = connectionfromurl('http://google.com/')\n>>> r = conn.request('GET', '/')\n\n#### disable_warnings\n\nHelper for quickly disabling all urllib3 warnings.\n\n#### encode_multipart_formdata\n\nEncode a dictionary of ``fields`` using the multipart/form-data MIME format.\n\n:param fields:\nDictionary of fields or list of (key, :class:`~urllib3.fields.RequestField`).\n\n:param boundary:\nIf not specified, then a random boundary will be generated using\n:func:`urllib3.filepost.chooseboundary`.\n\n#### get_host\n\nDeprecated. Use :func:`parseurl` instead.\n\n#### make_headers\n\nShortcuts for generating request headers.\n\n:param keepalive:\nIf ``True``, adds 'connection: keep-alive' header.\n\n:param acceptencoding:\nCan be a boolean, list, or string.\n``True`` translates to 'gzip,deflate'.\nList will get joined by comma.\nString will be used as provided.\n\n:param useragent:\nString representing the user-agent you want, such as\n\"python-urllib3/0.6\"\n\n:param basicauth:\nColon-separated username:password string for 'authorization: basic ...'\nauth header.\n\n:param proxybasicauth:\nColon-separated username:password string for 'proxy-authorization: basic ...'\nauth header.\n\n:param disablecache:\nIf ``True``, adds 'cache-control: no-cache' header.\n\nExample::\n\n>>> makeheaders(keepalive=True, useragent=\"Batman/1.0\")\n{'connection': 'keep-alive', 'user-agent': 'Batman/1.0'}\n>>> makeheaders(acceptencoding=True)\n{'accept-encoding': 'gzip,deflate'}\n\n#### proxy_from_url\n\n### DATA\n\nall = ('HTTPConnectionPool', 'HTTPSConnectionPool', 'PoolManager',...\nlicense = 'MIT'\n\n### VERSION\n\n1.26.5\n\n### AUTHOR\n\nAndrey Petrov (andrey.petrov@shazow.net)\n\n### FILE\n\n/usr/lib/python3/dist-packages/urllib3/init.py\n\n"
        }
    ],
    "structuredContent": {
        "command": "urllib3",
        "section": "",
        "mode": "pydoc",
        "summary": "urllib3 - Python HTTP library with thread-safe connection pooling, file post support, user friendly, and more",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "PACKAGE CONTENTS",
                "lines": 14,
                "subsections": []
            },
            {
                "name": "CLASSES",
                "lines": 14,
                "subsections": [
                    {
                        "name": "class HTTPConnectionPool",
                        "lines": 307
                    },
                    {
                        "name": "class HTTPResponse",
                        "lines": 266
                    },
                    {
                        "name": "class HTTPSConnectionPool",
                        "lines": 250
                    },
                    {
                        "name": "class PoolManager",
                        "lines": 154
                    },
                    {
                        "name": "class ProxyManager",
                        "lines": 165
                    },
                    {
                        "name": "class Retry",
                        "lines": 218
                    },
                    {
                        "name": "class Timeout",
                        "lines": 170
                    }
                ]
            },
            {
                "name": "FUNCTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "add_stderr_logger",
                        "lines": 5
                    },
                    {
                        "name": "connection_from_url",
                        "lines": 18
                    },
                    {
                        "name": "disable_warnings",
                        "lines": 2
                    },
                    {
                        "name": "encode_multipart_formdata",
                        "lines": 9
                    },
                    {
                        "name": "get_host",
                        "lines": 2
                    },
                    {
                        "name": "make_headers",
                        "lines": 33
                    },
                    {
                        "name": "proxy_from_url",
                        "lines": 1
                    }
                ]
            },
            {
                "name": "DATA",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}