Package-level declarations

Types

Link copied to clipboard
class ChannelProvider(val size: Long? = null, val block: () -> ByteReadChannel)

Supplies a new ByteReadChannel.

Link copied to clipboard

A form builder type used in the formData builder function.

Link copied to clipboard

OutgoingContent with for the application/x-www-form-urlencoded formatted request.

Link copied to clipboard
data class FormPart<T : Any>(val key: String, val value: T, val headers: Headers = Headers.Empty)

A multipart form item. Use it to build a form in client.

Link copied to clipboard
class InputProvider(val size: Long? = null, val block: () -> Input)

A reusable Input form entry.

Link copied to clipboard
class MultiPartFormDataContent(parts: List<PartData>, val boundary: String = generateBoundary(), val contentType: ContentType = ContentType.MultiPart.FormData.withParameter("boundary", boundary)) : OutgoingContent.WriteChannelContent

OutgoingContent for a multipart/form-data formatted request.

Functions

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 formData(vararg values: FormPart<*>): List<PartData>

Builds a multipart form from values.

fun formData(block: FormBuilder.() -> Unit): List<PartData>

Build multipart form using block function.

Link copied to clipboard
inline suspend fun HttpClient.prepareForm(formParameters: Parameters = Parameters.Empty, encodeInQuery: Boolean = false, block: HttpRequestBuilder.() -> Unit = {}): HttpStatement
suspend fun HttpClient.prepareForm(url: String, formParameters: Parameters = Parameters.Empty, encodeInQuery: Boolean = false, block: HttpRequestBuilder.() -> Unit = {}): HttpStatement

Prepares a request containing form parameters encoded using the x-www-form-urlencoded format.

Link copied to clipboard
inline suspend fun HttpClient.prepareFormWithBinaryData(formData: List<PartData>, crossinline block: HttpRequestBuilder.() -> Unit = {}): HttpStatement
inline suspend fun HttpClient.prepareFormWithBinaryData(url: String, formData: List<PartData>, crossinline block: HttpRequestBuilder.() -> Unit = {}): HttpStatement

Prepares a POST request containing form parameters encoded using the multipart/form-data format.

Link copied to clipboard
inline suspend fun HttpClient.submitForm(formParameters: Parameters = Parameters.Empty, encodeInQuery: Boolean = false, block: HttpRequestBuilder.() -> Unit = {}): HttpResponse
suspend fun HttpClient.submitForm(url: String, formParameters: Parameters = Parameters.Empty, encodeInQuery: Boolean = false, block: HttpRequestBuilder.() -> Unit = {}): HttpResponse

Makes a request containing form parameters encoded using the x-www-form-urlencoded format.

Link copied to clipboard
inline suspend fun HttpClient.submitFormWithBinaryData(formData: List<PartData>, block: HttpRequestBuilder.() -> Unit = {}): HttpResponse
inline suspend fun HttpClient.submitFormWithBinaryData(url: String, formData: List<PartData>, block: HttpRequestBuilder.() -> Unit = {}): HttpResponse

Makes a POST request containing form parameters encoded using the multipart/form-data format.