FormBuilder

A form builder type used in the formData builder function.

Functions

Link copied to clipboard
fun <T : Any> append(part: FormPart<T>)

Appends a form part.

fun <T : Any> append(key: String, value: T, headers: Headers = Headers.Empty)
fun append(key: String, value: InputProvider, headers: Headers = Headers.Empty)
fun append(key: String, value: ByteReadPacket, headers: Headers = Headers.Empty)
fun append(key: String, value: Boolean, headers: Headers = Headers.Empty)
fun append(key: String, value: ByteArray, headers: Headers = Headers.Empty)
fun append(key: String, value: Number, headers: Headers = Headers.Empty)
fun append(key: String, value: String, headers: Headers = Headers.Empty)

Appends a pair key:value with optional headers.

fun append(key: String, value: ChannelProvider, headers: Headers = Headers.Empty)

Appends a pair key:ChannelProvider with optional headers.

fun append(key: String, values: Array<String>, headers: Headers = Headers.Empty)
fun append(key: String, values: Iterable<String>, headers: Headers = Headers.Empty)

Appends a pair key:values with optional headers.

Link copied to clipboard
inline fun FormBuilder.append(key: String, headers: Headers = Headers.Empty, size: Long? = null, crossinline bodyBuilder: BytePacketBuilder.() -> Unit)

Appends a form part with the specified key using bodyBuilder for its body.

fun FormBuilder.append(key: String, filename: String, contentType: ContentType? = null, size: Long? = null, bodyBuilder: BytePacketBuilder.() -> Unit)

Appends a form part with the specified key, filename, and optional contentType using bodyBuilder for its body.

Link copied to clipboard
fun appendInput(key: String, headers: Headers = Headers.Empty, size: Long? = null, block: () -> Input)

Appends a pair key:InputProvider(block) with optional headers.