sendStreaming method

  1. @override
Future<StreamedApiResponse> sendStreaming(
  1. ApiRequest request
)
override

Send a request and return a streaming response.

Used for Server-Sent Events and other streaming formats where the response body should not be fully buffered.

Implementation

@override
Future<StreamedApiResponse> sendStreaming(ApiRequest request) async {
  requests.add(request);
  return nextStreamedResponse ??
      StreamedApiResponse(statusCode: 200, byteStream: const Stream.empty());
}