python-zeep
python-zeep copied to clipboard
why session is not used in AsyncTransport ?
the session
param is not used.
https://github.com/mvantellingen/python-zeep/blob/4e16b7726b5027e83d0dbe911bd45f153b7a09dc/src/zeep/transports.py#L173
I'm using Api key on session
header, it would be nice to be used in the following init lines.
self.wsdl_client.headers = {
"User-Agent": "Zeep/%s (www.python-zeep.org)" % (get_version())
**dict(session.headers),
}
self.client.headers = {
"User-Agent": "Zeep/%s (www.python-zeep.org)" % (get_version())
**dict(session.headers),
}
Hello, @mathbeal. You can achieve that by using the AsyncTransport.client.headers
attribute instead of session
:
transport = AsyncTransport()
# https://www.python-httpx.org/advanced/#sharing-configuration-across-requests
transport.client.headers.update({"X-Api-Key": "top-secret"})
The session attribute seems to be deprecated after migration from aiohttp to httpx.