Scoop API

scoop:scoop.http.client:0.1.0

HttpResponseBody

class HttpResponseBody

source · line 13
public
public class HttpResponseBody internal constructor(private val input: ClientResponseInput, private val fields: Array<HttpField>) : AsyncByteSource, AsyncCloseable

A single forward-only response-body cursor with optional content decoding. Reads must not overlap; buffering helpers require an explicit byte limit.

property contentLength

source · line 24
public
public val contentLength: Long?

get: public read-only

The length of the delivered representation when known; automatic decoding can make this unknown.

function close

source · line 86
public
public override suspend fun close(): Unit

Ends body consumption and awaits upload, stream, and call cleanup.

function text

source · line 54
public
public suspend fun text(maxBytes: Long, charset: Charset? = None, options: CharsetDecodeOptions = CharsetDecodeOptions(), malformedInput: CharsetErrorAction = CharsetErrorAction.Strict): String

Buffers under maxBytes and decodes using the explicit charset, Content-Type charset, or UTF-8 fallback. Malformed input is strict unless replacement is requested.