class HttpRequestBody
source · line 9public class HttpRequestBody internal constructor(
source: AsyncByteSource,
limit: Long? = Some(8388608L),
private val fields: Array<HttpField> = [],
/** The server-configured default limit used by aggregate helpers. */
public val bufferedBodyLimit: Long = 2097152L
)
A request body with one explicit consumption path and bounded input and decoding.
function bytes
source · line 46public suspend fun bytes(maxBytes: Long = bufferedBodyLimit): Array<Byte>
Reads one complete body into a bounded independent snapshot.
parameter maxBytes
source · line 46maxBytes: Long = bufferedBodyLimit
function setLimit
source · line 41public fun setLimit(maxBytes: Long?): Unit
Overrides the encoded input limit before selecting a consumption path; None disables it.
parameter maxBytes
source · line 41maxBytes: Long?
function openStream
source · line 26public fun openStream(): AsyncByteSource
Claims the body once, applying an installed request decoding policy.
property isComplete
source · line 21public val isComplete: Boolean
get: public read-only
Whether the selected source has reached its normal, validated EOF.
getter get
source · line 21get(): Boolean
function json
source · line 60public suspend fun <T> json(codec: ValueDecoder<T>, maxBytes: Long = bufferedBodyLimit): T
Decodes one bounded UTF-8 JSON body using an explicit codec.
parameter codec
source · line 60codec: ValueDecoder<T>
type parameter T
source · line 60T
parameter maxBytes
source · line 60maxBytes: Long = bufferedBodyLimit
function json
source · line 72public suspend fun <T> json(maxBytes: Long = bufferedBodyLimit): T where T.Companion: ValueDecoder<T>
Decodes one bounded JSON body using the type's companion codec.
type parameter T
source · line 72T
parameter maxBytes
source · line 72maxBytes: Long = bufferedBodyLimit
function form
source · line 76public suspend fun form(maxBytes: Long = bufferedBodyLimit): RequestQuery
Decodes a bounded form body, where plus represents a space.
parameter maxBytes
source · line 76maxBytes: Long = bufferedBodyLimit
function multipart
source · line 31public fun multipart(options: RequestMultipartOptions = requestMultipartOptions()): RequestMultipart
Selects one lazy form-data reader, whose local resources also belong to this request.
parameter options
source · line 32options: RequestMultipartOptions = requestMultipartOptions()
function text
source · line 56public suspend fun text(maxBytes: Long = bufferedBodyLimit): String
Reads a complete, bounded, strictly UTF-8 request body.
parameter maxBytes
source · line 56maxBytes: Long = bufferedBodyLimit
property bufferedBodyLimit
source · line 14public val bufferedBodyLimit: Long = 2097152L
get: public read-only
The server-configured default limit used by aggregate helpers.
function openRawStream
source · line 28public fun openRawStream(): AsyncByteSource
Claims the encoded body once, bypassing any installed content decoding.
property view
source · line 23public val view: HttpRequestBodyView?
get: public read-only
Selected decoding and length facts, or None before a consumer is chosen.
getter get
source · line 23get(): Option<HttpRequestBodyView>