dvStreamHttpRequest function

Future<DVHttpStreamedResponse> dvStreamHttpRequest(
  1. DVHttpRequest request
)

Sends request and yields the body as it arrives.

Server-sent events and long-running responses cannot go through dvSendHttpRequest, which waits for the whole body: a stream that never ends would never return. A request with a DVHttpRequest.connectAddress skips the installed transports, none of which can be told where to connect, and goes over the pinned connection instead. Sending it unpinned would make the pin a suggestion.

Implementation

Future<DVHttpStreamedResponse> dvStreamHttpRequest(DVHttpRequest request) =>
    request.connectAddress == null
        ? DVHttpFallbackClient(dvHttpTransport).stream(request)
        : pinned.dvPinnedStreamHttpRequest(request);