Typing Improvement - Client mounts #2979
-
The Following the logic described in Take the following example: import httpx
mounts = {
"http://": httpx.HTTPTransport(proxy=httpx.Proxy(url="http://my-proxy:8030")),
"https://": httpx.HTTPTransport(proxy=httpx.Proxy(url="http://my-proxy:8030")),
"all://*.my-domain.com": None # Disable all proxying to specific domain and use specified transport instead
}
with httpx.Client(
transport=httpx.HTTPTransport(verify=False),
mounts=mounts
) as client:
# Should not use a proxy
# Defaults to the provided transprot
response = client.get("https://foo.my-domain.com/get")
# Should use a proxy
response = client.get("https://httpbin.org/get") Type-checker fails with:
But seems to be a valid use-case here according to the logic defined in the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I think it has been resolved in #2879 |
Beta Was this translation helpful? Give feedback.
I think it has been resolved in #2879