From 5ced56b5b55813bc38d571fdba6176842c0ec716 Mon Sep 17 00:00:00 2001 From: Ahmed Maher Date: Sat, 28 Sep 2019 22:55:19 +0300 Subject: [PATCH] Expose ASGIDispatch & WSGIDispatch in the 'dispatch' namespace. (#407) --- docs/advanced.md | 2 +- httpx/dispatch/__init__.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/advanced.md b/docs/advanced.md index 6acad3b6..99fbb651 100644 --- a/docs/advanced.md +++ b/docs/advanced.md @@ -53,7 +53,7 @@ For example: ```python # Instantiate a client that makes WSGI requests with a client IP of "1.2.3.4". -dispatch = httpx.WSGIDispatch(app=app, remote_addr="1.2.3.4") +dispatch = httpx.dispatch.WSGIDispatch(app=app, remote_addr="1.2.3.4") client = httpx.Client(dispatch=dispatch) ``` diff --git a/httpx/dispatch/__init__.py b/httpx/dispatch/__init__.py index 4057d6ea..3089371f 100644 --- a/httpx/dispatch/__init__.py +++ b/httpx/dispatch/__init__.py @@ -2,3 +2,7 @@ Dispatch classes handle the raw network connections and the implementation details of making the HTTP request and receiving the response. """ +from .asgi import ASGIDispatch +from .wsgi import WSGIDispatch + +__all__ = ["ASGIDispatch", "WSGIDispatch"]