Package io.ktor.client.request.forms
Types
Link copied to clipboard
Form builder type used in formData builder function.
Link copied to clipboard
class FormDataContent(formData: Parameters) : OutgoingContent.ByteArrayContent
Content copied to clipboard
OutgoingContent with for application/x-www-form-urlencoded formatted request.
Link copied to clipboard
Reusable Input form entry.
Link copied to clipboard
class MultiPartFormDataContent(parts: List<PartData>) : OutgoingContent.WriteChannelContent
Content copied to clipboard
OutgoingContent for 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)
Content copied to clipboard
Append a form part with the specified key using bodyBuilder for it's body.
fun FormBuilder.append(key: String, filename: String, contentType: ContentType? = null, size: Long? = null, bodyBuilder: BytePacketBuilder.() -> Unit)
Content copied to clipboard
Append a form part with the specified key, filename and optional contentType using bodyBuilder for it's body.
Link copied to clipboard
inline suspend fun <T> HttpClient.submitForm(formParameters: Parameters = Parameters.Empty, encodeInQuery: Boolean = false, block: HttpRequestBuilder.() -> Unit = {}): T
Content copied to clipboard
inline suspend fun <T> HttpClient.submitForm(url: String, formParameters: Parameters = Parameters.Empty, encodeInQuery: Boolean = false, block: HttpRequestBuilder.() -> Unit = {}): T
Content copied to clipboard
inline suspend fun <T> HttpClient.submitForm(scheme: String = "http", host: String = "localhost", port: Int = 80, path: String = "/", formParameters: Parameters = Parameters.Empty, encodeInQuery: Boolean = false, block: HttpRequestBuilder.() -> Unit = {}): T
Content copied to clipboard
Submit formParameters request.
Link copied to clipboard
inline suspend fun <T> HttpClient.submitFormWithBinaryData(formData: List<PartData>, block: HttpRequestBuilder.() -> Unit = {}): T
Content copied to clipboard
inline suspend fun <T> HttpClient.submitFormWithBinaryData(scheme: String = "http", host: String = "localhost", port: Int = 80, path: String = "/", formData: List<PartData> = emptyList(), block: HttpRequestBuilder.() -> Unit = {}): T
Content copied to clipboard
Send HttpMethod.Post request with formData encoded in body. formData encoded using multipart/form-data format. https://tools.ietf.org/html/rfc2045
inline suspend fun <T> HttpClient.submitFormWithBinaryData(url: String, formData: List<PartData>, block: HttpRequestBuilder.() -> Unit = {}): T
Content copied to clipboard
Send HttpMethod.Post request with formData encoded in body. url destination formData encoded using multipart/form-data format.