]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Minor fixes fix-docs
authorKar Petrosyan <kar.petrosyanpy@gmail.com>
Thu, 24 Oct 2024 10:09:38 +0000 (14:09 +0400)
committerKar Petrosyan <kar.petrosyanpy@gmail.com>
Thu, 24 Oct 2024 10:09:38 +0000 (14:09 +0400)
docs/advanced/transports.md

index d4e7615d380b94a269babb492ac2dbfe2e39d57e..3260a94e118759d44ed538fa7d4c47ad842fcf5e 100644 (file)
@@ -175,7 +175,7 @@ class HelloWorldTransport(httpx.BaseTransport):
         return httpx.Response(200, json={"text": "Hello, world!"})
 ```
 
-Or this example, which uses a custom transport and `httpx.Mounts` to always redirect `http://` requests.
+Or this example, which uses a custom transport and `mounts` parameter to always redirect `http://` requests.
 
 ```python
 class HTTPSRedirect(httpx.BaseTransport):
@@ -187,11 +187,11 @@ class HTTPSRedirect(httpx.BaseTransport):
         return httpx.Response(303, headers={"Location": str(url)})
 
 # A client where any `http` requests are always redirected to `https`
-transport = httpx.Mounts({
+mounts = {
     'http://': HTTPSRedirect()
     'https://': httpx.HTTPTransport()
-})
-client = httpx.Client(transport=transport)
+}
+client = httpx.Client(mounts=mounts)
 ```
 
 A useful pattern here is custom transport classes that wrap the default HTTP implementation. For example...