Skip to main content

HTTP/2 for Python

Project description

HTTP is changing under our feet. HTTP/1.1, our old friend, is being supplemented by the brand new HTTP/2 standard. HTTP/2 provides many benefits: improved speed, lower bandwidth usage, better connection management, and more.

hyper provides these benefits to your Python code. How? Like this:

from hyper import HTTP20Connection

conn = HTTP20Connection('')
conn.request('GET', '/')
resp = conn.getresponse()



Caveat Emptor!

Please be warned: hyper is in a very early alpha. You will encounter bugs when using it. In addition, there are very many rough edges. With that said, please try it out in your applications: I need your feedback to fix the bugs and file down the rough edges.


hyper provides support for draft 14 of the HTTP/2 draft specification and draft 9 of the HPACK draft specification. As further drafts are released, hyper will be updated to support them.


hyper is intended to be a drop-in replacement for http.client, with a similar API. However, hyper intentionally does not name its classes the same way http.client does. This is because most servers do not support HTTP/2 at this time: I don’t want you accidentally using hyper when you wanted http.client.


hyper welcomes contributions from anyone! Unlike many other projects we are happy to accept cosmetic contributions and small contributions, in addition to large feature requests and changes.

Before you contribute (either by opening an issue or filing a pull request), please read the contribution guidelines.


hyper is made available under the MIT License. For more details, see the LICENSE file in the repository.


hyper is maintained by Cory Benfield, with contributions from others. For more details about the contributors, please see CONTRIBUTORS.rst.

Release History

0.1.0 (2014-08-16)

Regressions and Known Bugs

  • Support for Python 3.3 has been temporarily dropped due to features missing from the Python 3.3 ssl module. PyOpenSSL has been identified as a replacement, but until NPN support is merged it cannot be used. Python 3.3 support will be re-added when a suitable release of PyOpenSSL is shipped.
  • Technically this release also includes support for PyPy and Python 2.7. That support is also blocked behind a suitable PyOpenSSL release.

For more information on these regressions, please see Issue #37.

Major Changes

  • Support for HPACK draft 9.
  • Support for HTTP/2 draft 14.
  • Support for Sever Push, thanks to @alekstorm. (Issue #40)
  • Use a buffered socket to avoid unnecessary syscalls. (Issue #56)
  • If nghttp2 is present, use its HPACK encoder for improved speed and compression efficiency. (Issue #60)
  • Add HTTP20Response.gettrailer() and HTTP20Response.gettrailers(), supporting downloading and examining HTTP trailers. (Discussed in part in Issue #71.)


  • HTTP20Response objects are context managers. (Issue #24)
  • Pluggable window managers are now correctly informed about the document size. (Issue #26)
  • Header blocks can no longer be corrupted if read in a different order to the one in which they were sent. (Issue #39)
  • Default window manager is now smarter about sending WINDOWUPDATE frames. (Issue #41 and Issue #52)
  • Fixed inverted window sizes. (Issue #27)
  • Correct reply to PING frames. (Issue #48)
  • Made the wheel universal, befitting a pure-Python package. (Issue #46)
  • HPACK encoder correctly encodes header sets with duplicate headers. (Issue #50)

0.0.4 (2014-03-08)

  • Add logic for pluggable objects to manage the flow-control window for both connections and streams.
  • Raise new HPACKDecodingError when we’re unable to validly map a Huffman-encoded string.
  • Correctly respect the HPACK EOS character.

0.0.3 (2014-02-26)

  • Use bundled SSL certificates in addition to the OS ones, which have limited platform availability. (Issue #9)
  • Connection objects reset to their basic state when they’re closed, enabling them to be reused. Note that they may not be reused if exceptions are thrown when they’re in use: you must open a new connection in that situation.
  • Connection objects are now context managers. (Issue #13)
  • The HTTP20Adapter correctly reuses connections.
  • Stop sending WINDOWUPDATE frames with a zero-size window increment.
  • Provide basic functionality for gracelessly closing streams.
  • Exhausted streams are now disposed of. (Issue #14)

0.0.2 (2014-02-20)

  • Implemented logging. (Issue #12)
  • Stopped HTTP/2.0 special headers appearing in the response headers. (Issue #16)
  • HTTP20Connection objects are now context managers. (Issue #13)
  • Response bodies are automatically decompressed. (Issue #20)
  • Provide a requests transport adapter. (Issue #19)
  • Fix the build status indicator. (Issue #22)

0.0.1 (2014-02-11)

  • Initial Release
  • Support for HTTP/2.0 draft 09.
  • Support for HPACK draft 05.
  • Support for HTTP/2.0 flow control.
  • Verifies TLS certificates.
  • Support for streaming uploads.
  • Support for streaming downloads.

Project details

Release history Release notifications

History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


This version
History Node


History Node


History Node


History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
hyper-0.1.0-py2.py3-none-any.whl (213.0 kB) Copy SHA256 hash SHA256 Wheel 3.4 Aug 16, 2014
hyper-0.1.0.tar.gz (221.2 kB) Copy SHA256 hash SHA256 Source None Aug 16, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page