StreamResponseDefinition

constructor(chunkFlow: Flow<T>? = null, chunks: List<T>? = null, delayBetweenChunks: Duration = Duration.ZERO, contentType: ContentType = ContentType.Text.EventStream.withCharset(Charsets.UTF_8), chunkContentType: ContentType? = null, httpStatusCode: Int = 200, httpStatus: HttpStatusCode = HttpStatusCode.fromValue(httpStatusCode), headers: ResponseHeaders.() -> Unit? = null, delay: Duration, formatter: HttpFormatter)(source)

Initializes a streaming response definition with the specified flow, chunk list, content type, HTTP status code, and headers.

Parameters

P

The type of the request body.

T

The type of the response data being streamed.