Closed martin-thoma closed 3 years ago
h2 itself is just a bare-bones sans-io library. Meaning, you need to handle your own I/O operations and understand the HTTP/2 protocol to make sense of the emitted events from h2. A good starting point is also the first code snippet in our main README file and our HTTP client examples: https://python-hyper.org/projects/hyper-h2/en/stable/examples.html#example-clients
If you want a fully-fledged HTTP library to send requests and read responses, I suggest https://www.python-httpx.org/ (which we also recommend as hyper
replacement)
I wanted to use httpx, but it didn't work:
I'm trying to communicate with the Apple Push Notification service (APN) which uses HTTP/2 (docs).
I've (sucessfully) used hyper before for that with code that roughly looks like this:
How would an equivalent with h2 look like?