class ASGITransport(AsyncBaseTransport): (source)
A custom AsyncTransport that handles sending requests directly to an ASGI app. The simplest way to use this functionality is to use the `app` argument. ``` client = httpx.AsyncClient(app=app) ``` Alternatively, you can setup the transport instance explicitly. This allows you to include any additional configuration arguments specific to the ASGITransport class: ``` transport = httpx.ASGITransport( app=app, root_path="/submount", client=("1.2.3.4", 123) ) client = httpx.AsyncClient(transport=transport) ``` Arguments: * `app` - The ASGI application. * `raise_app_exceptions` - Boolean indicating if exceptions in the application should be raised. Default to `True`. Can be set to `False` for use cases such as testing the content of a client 500 response. * `root_path` - The root path on which the ASGI application should be mounted. * `client` - A two-tuple indicating the client IP and port of incoming requests. ```
Method | __init__ |
Undocumented |
Async Method | handle |
Undocumented |
Instance Variable | app |
Undocumented |
Instance Variable | client |
Undocumented |
Instance Variable | raise |
Undocumented |
Instance Variable | root |
Undocumented |
Inherited from AsyncBaseTransport
:
Async Method | __aenter__ |
Undocumented |
Async Method | __aexit__ |
Undocumented |
Async Method | aclose |
Undocumented |