Skip to content

Better HTTP/2 defaults. - #584

Merged
lovelydinosaur merged 4 commits into
masterfrom
http_2_defaults
Dec 2, 2019
Merged

lovelydinosaur merged 4 commits into
masterfrom
http_2_defaults

Conversation

@lovelydinosaur

@lovelydinosaur lovelydinosaur commented Dec 2, 2019 •

Copy link
Copy Markdown
Member
  • HTTP/2 is off by default.
  • Client(http2=True) to enable
  • Added HTTP/2 docs.

Closes #582

Still TODO:

API changes for http_version=... to http_2=[True|False], so we should leave this to a 0.9 release.

@florimondmanca florimondmanca left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took a glance at the docs and found a few typos.

I like this change!

I suppose this moves us forward relative to minimal dependencies, eg we’ll now be able to not require h2 unless users want to use HTTP/2?

Comment thread docs/http2.md Outdated
Comment thread docs/http2.md Outdated
Comment thread docs/http2.md Outdated
@lovelydinosaur

Copy link
Copy Markdown
Member Author

I suppose this moves us forward relative to minimal dependencies, eg we’ll now be able to not require h2 unless users want to use HTTP/2?

Ah yeah I'd forgotten about that. We can also make that switch here, yup.
I guess we would drop h2 out of our default install, and into extra_requires, so...

pip install httpx[h2]

And a check on the client for "if http_2 is True and h2 is not installed then error".

@florimondmanca

Copy link
Copy Markdown
Contributor

We can also make that switch here, yup.

I’d rather we deal with it later, this PR is quite a big chunk already. :-)

@lovelydinosaur

Copy link
Copy Markdown
Member Author

Good call.

@lovelydinosaur lovelydinosaur changed the title HTTP/2 defaults Better HTTP/2 defaults. Dec 2, 2019
@lovelydinosaur

Copy link
Copy Markdown
Member Author

Should we use httpx.Client(http_2=True) or httpx.Client(http2=True)?

I think the later is probably neater, right?

@lovelydinosaur
lovelydinosaur merged commit 30229f1 into master Dec 2, 2019
@lovelydinosaur
lovelydinosaur deleted the http_2_defaults branch December 2, 2019 17:07
@florimondmanca

Copy link
Copy Markdown
Contributor

Just remembered we had a "Minimal installs" issue here — #496.

Kludex referenced this pull request in pydantic/httpx2 May 11, 2026
Bumps [coverage](https://github.com/nedbat/coveragepy) from 6.4.4 to 6.5.0.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](coveragepy/coveragepy@6.4.4...6.5.0)

---
updated-dependencies:
- dependency-name: coverage
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

HTTP/2 should be off by default.

2 participants