---
title: "stream"
sidebar_label: "stream"
description: "Kotlin binding reference: stream."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../../index.md)/[io.clika.runtime](../../index.md)/[ServerResponse](../index.md)/[Companion](index.md)/[stream](stream.md)

# stream

[common]\
fun [stream](stream.md)(contentType: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), producer: [ChunkProducer](../../ChunkProducer/index.md)): [ServerResponse](../index.md)

A chunked body pulled from [producer](stream.md) on a server worker until it answers null; a producer that raises ends the stream (the headers are already out, so the runtime's log line is the only signal).