I'm trying to send some HTTP/2 data with hyper 0.7.0 as the client. The data is getting chunked into 1024 byte segments before being sent to the server (much to my chagrin). As I look through the HTTP/2 SETTINGs packets I don't see anything that would lower the size below 64 kB, which I believe to be the default for the connection and for the streams. Is there a way to know why 1024 is being chosen, and how to increase it?
I've tried:
from hyper import HTTP20Connection
from hyper.http20.window import BaseFlowControlManager
...
class LargerWindowControlManager(BaseFlowControlManager):
def __init__(self, *args, **kwargs):
super().__init__(64000)
...
remote_connection = HTTP20Connection(f'{remote_node}', timeout=600)
remote_connection.network_buffer_size = 256000
...
remote_connection.request('POST', f'{path}', body=data, headers=headers, window_manager=LargerWindowControlManager)
My data
is about 2557 bytes long, and this is being sent in Stream ID = 1 as three separate body fragments. While I think this should be perfectly valid, it is the only difference I can find between a working HTTP/2 POST (with curl --http2-prior-knowledge
) and the failing HTTP/2 POST with hyper
. When I use curl
it sends the data in a single packet (of length 2557 bytes) and the server responds with success. But when I send the same data with the same headers with hyper
, I get a failure (404
). So I'm trying to get the data to be sent in a single packet rather than segmented across three. Any tips?