From: Paul (xobb) Chubatyy Date: Thu, 12 Sep 2019 20:39:22 +0000 (-0700) Subject: Add example of specifying HTTP versions (#337) X-Git-Tag: 0.7.3~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c4460e622bc9e882650876732b27349254b3b16;p=thirdparty%2Fhttpx.git Add example of specifying HTTP versions (#337) Closes #336 --- diff --git a/docs/advanced.md b/docs/advanced.md index 20122f20..dba5128d 100644 --- a/docs/advanced.md +++ b/docs/advanced.md @@ -70,6 +70,20 @@ make modifications before sending the request. ``` +## Specify the version of HTTP protocol + +One can set the version of HTTP protocol for the client in case you want to make the requests using specific version. + +For example: + +```python +h11_client = httpx.Client(http_versions=["HTTP/1.1"]) +h11_response = h11_client.get("https://myserver.com") + +h2_client = httpx.Client(http_versions=["HTTP/2"]) +h2_response = h2_client.get("https://myserver.com") +``` + ## .netrc Support HTTPX supports .netrc file. In `trust_env=True` cases, if auth parameter is