From bafa32aa674aafb75e17084307d336fb97ef9c35 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 22 May 2020 10:16:08 +0100 Subject: [PATCH 1/3] Update HTTP/2 docs --- docs/http2.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/http2.md b/docs/http2.md index d68a908d49..45a08cdec0 100644 --- a/docs/http2.md +++ b/docs/http2.md @@ -18,12 +18,10 @@ For a comprehensive guide to HTTP/2 you may want to check out "[HTTP2 Explained] ## Enabling HTTP/2 -The HTTPX client provides HTTP/2 support, **which is currently only available with the async client**. - -HTTP/2 support is not enabled by default, because HTTP/1.1 is a mature, -battle-hardened transport layer, and our HTTP/1.1 may be considered the more robust -option at this point in time. It is possible that a future version of `httpx` may -enable HTTP/2 support by default. +When using the `httpx` client, HTTP/2 support is not enabled by default, because +HTTP/1.1 is a mature, battle-hardened transport layer, and our HTTP/1.1 +implementation may be considered the more robust option at this point in time. +It is possible that a future version of `httpx` may enable HTTP/2 support by default. If you're issuing highly concurrent requests you might want to consider trying out our HTTP/2 support. You can do so by instantiating a client with @@ -43,6 +41,10 @@ async with httpx.AsyncClient(http2=True) as client: ... ``` +HTTP/2 support is available on both `Client`, and `AsyncClient`, although it's +typically more useful in async contexts if you're issuing lots of concurrent +requests. + ## Inspecting the HTTP version Enabling HTTP/2 support on the client does not *necessarily* mean that your From abb84cbbaaf9f641b9d756dfe31a5b4c87d8473c Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 22 May 2020 10:18:26 +0100 Subject: [PATCH 2/3] Include URLLib3ProxyTransport in top-level API --- httpx/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/httpx/__init__.py b/httpx/__init__.py index d7fad2ddd9..cc96c84d87 100644 --- a/httpx/__init__.py +++ b/httpx/__init__.py @@ -26,7 +26,7 @@ from ._models import URL, Cookies, Headers, QueryParams, Request, Response from ._status_codes import StatusCode, codes from ._transports.asgi import ASGIDispatch, ASGITransport -from ._transports.urllib3 import URLLib3Transport +from ._transports.urllib3 import URLLib3Transport, URLLib3ProxyTransport from ._transports.wsgi import WSGIDispatch, WSGITransport __all__ = [ @@ -74,6 +74,7 @@ "WriteTimeout", "URL", "URLLib3Transport", + "URLLib3ProxyTransport", "StatusCode", "Cookies", "Headers", From f70731eb432b3819cf9a3a1eef40c72bc1e6d3c1 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 22 May 2020 10:26:27 +0100 Subject: [PATCH 3/3] Linting --- httpx/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httpx/__init__.py b/httpx/__init__.py index cc96c84d87..35d5975db7 100644 --- a/httpx/__init__.py +++ b/httpx/__init__.py @@ -26,7 +26,7 @@ from ._models import URL, Cookies, Headers, QueryParams, Request, Response from ._status_codes import StatusCode, codes from ._transports.asgi import ASGIDispatch, ASGITransport -from ._transports.urllib3 import URLLib3Transport, URLLib3ProxyTransport +from ._transports.urllib3 import URLLib3ProxyTransport, URLLib3Transport from ._transports.wsgi import WSGIDispatch, WSGITransport __all__ = [