Skip to content

HTTP/2 should be off by default. #582

Closed

Description

@lovelydinosaur

So...

I'm super excited that we've got an HTTP/2 implementation in here, but we also need to consider what default behavior we should be aiming for, and what we should prioritise.

Our HTTP/2 implementation is neccessarily going to be more complex, and less mature than our HTTP/1.1 implementation. Even if that wasn't the case, then HTTP/2 infrastructure that we're connecting too is more likely to have implementation issue and quirks than HTTP/1.1 versions.

I think we ought to clearly be prioritizing for reliablity, while still supporting users that want the more cutting-edge functionality.

I'd suggest that:

  • We ought to have a documentation page on HTTP/2, with a brief overview of the primary differences, and motivation as to why user might or might not want to switch HTTP/2 support on.
  • We ought to tidy up our interface for switching between HTTP versions.

We currently have this...

client = Client(http_versions=["HTTP/1.1", "HTTP/2"])  # Really clunky
client = Client(http_versions=["HTTP/1.1"]) 
client = Client(http_versions=["HTTP/2"])  # Doesn't really make sense - you *might* still end up with an HTTP/1.1 connection.

I think we should just switch to...

client = Client(http_2=True)
client = Client(http_2=False)

Furthermore, I think the default ought to be false. There's no point in exposing our users to this class of issues https://github.com/encode/httpx/issues?q=is%3Aissue+is%3Aopen+label%3Ahttp%2F2 as our default behaviour, but we can still make it easy for our users to upgrade to the HTTP/2 implementation.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions