Replies: 2 comments 1 reply
-
|
To force HTTP/2 prior knowledge, use... >>> client = httpx.Client(http1=False, http2=True) |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
thanks. it seems to work:
```
>> client = httpx.AsyncClient(http1=False, http2=True)
>> response = await client.get("http://localhost:8080/$")
>> response.http_version
'HTTP/2'
```
but then shouldn't this be the pattern to use? If one uses
```
>> client = httpx.AsyncClient(http2=True)
```
then even if server supports http2, we are using http1 which is suboptimal.
…On Sat, Apr 6, 2024 at 11:50 AM Tom Christie ***@***.***> wrote:
To force HTTP/2 prior knowledge, use...
>>> client = httpx.Client(http1=False, http2=True)
—
Reply to this email directly, view it on GitHub
<#3161 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A6NWEK3V6JFDHKGNZQP5RVTY4A7WNAVCNFSM6AAAAABF2TJRX2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TAMZRGI3DA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am new to httpx and trying to use http2 without TLS. My server is Spring Boot running embedded Tomcat as explained [here]. I verified a sample request returns
HTTP2usingcurl:but when I try to use
httpxaccording to [1] this is what I get:so it seems it not using http2. How can I get it to use http2? this is the first time I am trying httpx so apologies if I have overlooked something.
Beta Was this translation helpful? Give feedback.
All reactions