class RequestPart
source · line 10public class RequestPart internal constructor(part: MultipartPart, owner: RequestMultipart,
private val options: RequestMultipartOptions) : AsyncCloseable
- Supertype
AsyncCloseable
One ordered form-data part with strict text metadata and a single body consumption path.
function close
source · line 71public override suspend fun close(): Unit
- Overrides
close
Closes this view; abandoning an incomplete part terminates the multipart reader.
function discard
source · line 64public suspend fun discard(maxBytes: Long): Long
Explicitly discards remaining body bytes within both limits, even after a partial read.
parameter maxBytes
source · line 64maxBytes: Long
property name
source · line 26public val name: String
get: public read-only
The name interpreted strictly as UTF-8.
getter get
source · line 26get(): String
property filename
source · line 28public val filename: String?
get: public read-only
The optional filename interpreted strictly as UTF-8, without path processing.
getter get
source · line 28get(): Option<String>
property head
source · line 17public val head: MultipartPartHead
get: public read-only
The original ordered part fields; Content-Length does not change boundary framing.
function copyTo
source · line 57public suspend fun copyTo(sink: AsyncByteSink, maxBytes: Long): Long
Copies bounded content with backpressure, without flushing or closing the borrowed sink.
parameter sink
source · line 57sink: AsyncByteSink
parameter maxBytes
source · line 57maxBytes: Long
function text
source · line 43public suspend fun text(charset: Charset? = None): String
Collects text within the configured field and part limits.
parameter charset
source · line 43charset: Charset? = None
property isComplete
source · line 33public val isComplete: Boolean
get: public read-only
Whether this part reached its boundary through a positive-sized read or discard.
getter get
source · line 33get(): Boolean
function openStream
source · line 40public fun openStream(): AsyncByteSource
Claims a bounded stream that becomes invalid when iteration advances.
property nameBytes
source · line 19public val nameBytes: Array<Byte>
get: public read-only
The raw, unescaped name parameter, including an explicitly empty name.
property filenameBytes
source · line 21public val filenameBytes: Array<Byte>?
get: public read-only
The raw filename parameter; missing and empty filenames remain distinct.
function text
source · line 46public suspend fun text(maxBytes: Long, charset: Charset? = None): String
Collects text within the smaller of the explicit, configured field and part limits.
parameter charset
source · line 46charset: Charset? = None
parameter maxBytes
source · line 46maxBytes: Long