Skip to content

Commit

Permalink
docs: Add information about http auth for async client
Browse files Browse the repository at this point in the history
  • Loading branch information
cdvv7788 authored and mvantellingen committed Apr 11, 2021
1 parent 9ff4b5a commit f497b78
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/transport.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,27 @@ to the Transport class.
transport=Transport(session=session))
Async HTTP Authentication
-------------------------
The Async client for zeep uses a different backend, so the setup is different in this case.
You will need to use `httpx` to create an :class:`httpx.AsyncClient` object, and pass it to your :class:`zeep.AsyncTransport`.

.. code-block:: python
import httpx
import zeep
from zeep.transports import AsyncTransport
USER = 'username'
PASSWORD = 'password'
httpx_client = httpx.AsyncClient(auth=(USER, PASSWORD))
aclient = zeep.AsyncClient(
"http://my-endpoint.com/production.svc?wsdl",
transport=AsyncTransport(client=httpx_client)
)
.. _debugging:

Debugging
Expand Down

0 comments on commit f497b78

Please sign in to comment.