MCPcopy
hub / github.com/urllib3/urllib3 / connection_from_url

Method connection_from_url

src/urllib3/poolmanager.py:370–386  ·  view source on GitHub ↗

Similar to :func:`urllib3.connectionpool.connection_from_url`. If ``pool_kwargs`` is not provided and a new pool needs to be constructed, ``self.connection_pool_kw`` is used to initialize the :class:`urllib3.connectionpool.ConnectionPool`. If ``pool_kwargs``

(
        self, url: str, pool_kwargs: dict[str, typing.Any] | None = None
    )

Source from the content-addressed store, hash-verified

368 return pool
369
370 def connection_from_url(
371 self, url: str, pool_kwargs: dict[str, typing.Any] | None = None
372 ) -> HTTPConnectionPool:
373 """
374 Similar to :func:`urllib3.connectionpool.connection_from_url`.
375
376 If ``pool_kwargs`` is not provided and a new pool needs to be
377 constructed, ``self.connection_pool_kw`` is used to initialize
378 the :class:`urllib3.connectionpool.ConnectionPool`. If ``pool_kwargs``
379 is provided, it is used instead. Note that if a new pool does not
380 need to be created for the request, the provided ``pool_kwargs`` are
381 not used.
382 """
383 u = parse_url(url)
384 return self.connection_from_host(
385 u.host, port=u.port, scheme=u.scheme, pool_kwargs=pool_kwargs
386 )
387
388 def _merge_pool_kwargs(
389 self, override: dict[str, typing.Any] | None

Calls 2

connection_from_hostMethod · 0.95
parse_urlFunction · 0.85