def __init__(self, connection, request, on_response=None, on_body=None): assert isinstance(connection, HttpClientConnection) assert isinstance(request, HttpRequest) assert callable(on_response) or on_response is None assert callable(on_body) or on_body is None super(HttpClientStream, self).__init__(connection, on_body) self._on_response_cb = on_response self._response_status_code = None _awscrt.http_client_stream_new(self, connection, request)
def __init__(self, connection, request, on_response=None, on_body=None): assert isinstance(connection, HttpClientConnection) assert isinstance(request, HttpRequest) assert callable(on_response) or on_response is None assert callable(on_body) or on_body is None super().__init__(connection, on_body) self._on_response_cb = on_response self._response_status_code = None # keep HttpRequest alive until stream completes self._request = request self._binding = _awscrt.http_client_stream_new(self, connection, request)