Skip to content
Myr

Add note about adapter prefix match to docs (#6465)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Calle Svensson · committed by GitHub · parent dfe46c1 · Browse files · 1 file+4 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−0 removed

  • other:+4 added−0 removed

1 file+4 added−0 removed

modified:docs/user/advanced.rst+4 added
992 unmodified lines
993The mount call registers a specific instance of a Transport Adapter to a994prefix. Once mounted, any HTTP request made using that session whose URL starts995with the given prefix will use the given Transport Adapter.996997.. note:: The adapter will be chosen based on a longest prefix match. Be mindful998 prefixes such as ``http://localhost`` will also match ``http://localhost.other.com``999 or ``http://localhost@other.com``. It's recommended to terminate full hostnames with a ``/``.10001001Many of the details of implementing a Transport Adapter are beyond the scope of1002this documentation, but take a look at the next example for a simple SSL use-1003case. For more than that, you might look at subclassing the1004:class:`BaseAdapter <requests.adapters.BaseAdapter>`.
121 unmodified lines