class documentation

class ASGITransport(AsyncBaseTransport):

View In Hierarchy

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​_async​_request Undocumented
Instance Variable app Undocumented
Instance Variable client Undocumented
Instance Variable raise​_app​_exceptions Undocumented
Instance Variable root​_path Undocumented

Inherited from AsyncBaseTransport:

Async Method __aenter__ Undocumented
Async Method __aexit__ Undocumented
Async Method aclose Undocumented
def __init__(self, app, raise_app_exceptions=True, root_path='', client=('127.0.0.1', 123)):

Undocumented

Parameters
app:typing.CallableUndocumented
raise​_app​_exceptions:boolUndocumented
root​_path:strUndocumented
client:typing.Tuple[str, int]Undocumented
async def handle_async_request(self, request):

Undocumented

Parameters
request:RequestUndocumented
Returns
ResponseUndocumented
app =

Undocumented

client =

Undocumented

raise_app_exceptions =

Undocumented

root_path =

Undocumented