Closed km-pg closed 7 years ago
I suspect if you look you'll find that first
, second
, and third
are all None
, meaning that HTTP/2 was never negotiated. The example definitely will not work in that case. =)
Ah, you are right. I thought it would be HTTP/2 because when you go to that URL in Chrome, the protocol in the Developer Tools shows h2. Is it possible that a GET would be HTTP/2 and a POST would not be?
I switched to using GET, but it still isn't doing HTTP/2 it seems. Why is it in Chrome by not in hyper?
from hyper import HTTPConnection
c = HTTPConnection('api.segment.io', port=443)
stream_id = c.request('GET', '/v1/batch')
print(stream_id)
returns None
Nevermind. I'm running into this issue: https://github.com/Lukasa/hyper/issues/178
After installing python with pyenv, it worked.
Is there a way to tell if the connection is HTTP/2 before sending the first request?
Nope: we delay connection setup as long as possible so you can only tell based on whether you have a stream ID or None
.
The streams example from the quickstart guide isn't working. I changed it a little, but still can't get it to work:
Here's the error I'm getting: