Skip to content

introduce http2_prior_knowledge option in httpx Client#1523

Closed
p1-alexandrevaney wants to merge 2 commits into
encode:masterfrom
p1-alexandrevaney:feature/http2_prior_knowledge
Closed

introduce http2_prior_knowledge option in httpx Client#1523
p1-alexandrevaney wants to merge 2 commits into
encode:masterfrom
p1-alexandrevaney:feature/http2_prior_knowledge

Conversation

@p1-alexandrevaney

Copy link
Copy Markdown

This PR is to be used in conjuction with this httpcore PR.

It passes the http2_prior_knowledge option to the httpx client, which passes it to the httpcore AsyncConnectionPool instanciation.

I also added it to the http config model, to make sure that the alpn selected protocols only contains "h2" if the http2_prior_knowledge option is set to True.

@p1-alexandrevaney p1-alexandrevaney force-pushed the feature/http2_prior_knowledge branch from 5b4e97d to 75e0b2a Compare March 22, 2021 15:25
@lovelydinosaur

Copy link
Copy Markdown
Contributor

Okay, so...

Really this kind of PR could do with discussion first, although that's on us to help guide that process. (Which we're gradually starting to do.)

My initial thought on seeing this is that an API that adds http1=True|False might make more sense, since it'd be in line with our existing http2=True|False. When HTTP/1.x support is disabled on a client and HTTP/2 support is enabled, we could force HTTP/2 requests. (?)

@lovelydinosaur lovelydinosaur mentioned this pull request Mar 24, 2021
4 tasks
@p1-alexandrevaney

Copy link
Copy Markdown
Author

Hello 😄,

Yes i agree that a boolean http1=True|False seems more in line with the existing code.
This PR is also made to be used with a corresponding httpcore one which is heavier, could you please have a look at it so we can discuss what to change ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants