api

http4k / org.http4k.core / MultipartFormBody

MultipartFormBody

data class MultipartFormBody : Body, Closeable

Represents a Multi-part that is backed by a stream, which should be closed after handling the content. The gotchas which apply to StreamBody also apply here..

Constructors

Name Summary
<init> MultipartFormBody(boundary: String = UUID.randomUUID().toString())

Properties

Name Summary
boundary val boundary: String
length Will be null for bodies where it’s impossible to a priori determine - e.g. StreamBodyval length: Long?
payload val payload: ByteBuffer
stream val stream: InputStream

Functions

Name Summary
close fun close(): Unit
field fun field(name: String): MultipartFormField?
fields fun fields(name: String): List<MultipartFormField>
fieldValue fun fieldValue(name: String): String?
fieldValues fun fieldValues(name: String): List<String>
file fun file(name: String): MultipartFormFile?
files fun files(name: String): List<MultipartFormFile>
plus operator fun plus(field: Pair<String, String>): MultipartFormBody
operator fun plus(field: Pair<String, MultipartFormField>): MultipartFormBody
operator fun plus(field: Pair<String, MultipartFormFile>): MultipartFormBody
toString fun toString(): String

Companion Object Properties

Name Summary
DEFAULT_DISK_THRESHOLD const val DEFAULT_DISK_THRESHOLD: Int

Companion Object Functions

Name Summary
from fun from(httpMessage: HttpMessage, diskThreshold: Int = DEFAULT_DISK_THRESHOLD): MultipartFormBody

Extension Functions

Name Summary
gunzipped fun Body.gunzipped(): Body
gunzippedStream fun Body.gunzippedStream(): Body
gzipped fun Body.gzipped(): CompressionResult
gzippedStream fun Body.gzippedStream(): CompressionResult