h2
h2 copied to clipboard
How to reuse the connection to send multiple requests in plain socket example
I am loving the example here https://github.com/python-hyper/h2/blob/master/examples/plain_sockets/plain_sockets_client.py
I just can't seem to figure out how to be making multiple requests reusing the same connection?
For example, if I wanted to send the same request again, how could I do that after print("Response fully received:")
I understand I might need to use a next stream ID, but it is not clear how to do it. Any help would be much appreciated!
where the example uses 1 as stream id, use c.get_next_available_stream_id()