Package-level declarations

Types

Link copied to clipboard
class FileEntry(val key: String, val value: File) : FormDataEntry
class FileEntry(val key: String, val value: File) : FormDataEntry

A key to file value pair representing a segment of form upload data.

Link copied to clipboard
sealed class FormDataEntry
sealed class FormDataEntry

A key-value pair representing a segment of form upload data.

Link copied to clipboard
class StringEntry(val key: String, val value: String) : FormDataEntry
class StringEntry(val key: String, val value: String) : FormDataEntry

A key to string value pair representing a segment of form upload data.

Properties

Link copied to clipboard

The boundary specified in this ContentType, if any.

Link copied to clipboard

The file value as an array of bytes, if any.

Link copied to clipboard

The charset specified in this ContentType, if any.

Link copied to clipboard

A MIME type of the file content.

Link copied to clipboard

The file value as a path, if any.

Functions

Link copied to clipboard
fun ByteData(data: ByteArray, contentType: ContentType = OctetStream): ByteData
fun ByteData(data: ByteArray, contentType: ContentType = OctetStream): ByteData
fun ByteData(data: String, charset: Charset = Charsets.UTF_8, contentType: ContentType = OctetStream): ByteData
fun ByteData(data: String, charset: Charset = Charsets.UTF_8, contentType: ContentType = OctetStream): ByteData

Creates a new instance of ByteData with the given parameters.

Link copied to clipboard
fun ContentType(mediaType: String, charset: Charset? = null, boundary: String? = null): ContentType
fun ContentType(mediaType: String, charset: Charset? = null, boundary: String? = null): ContentType

Creates a new instance of ContentType with the given parameters.

Link copied to clipboard
fun File(): File
fun File(): File

Creates an empty File.

fun File(path: Path, mimeType: MimeType? = null, name: String? = null): File
fun File(path: Path, mimeType: MimeType? = null, name: String? = null): File

Creates a new instance of File based on the given path.

fun File(bytes: ByteArray, mimeType: MimeType? = null, name: String? = null): File
fun File(bytes: ByteArray, mimeType: MimeType? = null, name: String? = null): File

Creates a new instance of File based on the given bytes array.

Link copied to clipboard
fun FormData(vararg entries: StringEntry): FormData
fun FormData(vararg entries: StringEntry): FormData

Creates a new instance of FormData with the given entries.

Link copied to clipboard
fun Host(name: String): Host
fun Host(name: String): Host

Creates a new instance of Host with the given name.

Link copied to clipboard
fun HttpHeader(name: String, value: String): HttpHeader
fun HttpHeader(name: String, value: String): HttpHeader

Creates a new instance of HttpHeader with the given name and value.

Link copied to clipboard
fun MimeType(value: String): MimeType
fun MimeType(value: String): MimeType

Creates a new instance of MimeType with the given value.

Link copied to clipboard

Creates a new instance of MultipartFormData with the given entries.

Link copied to clipboard
fun Scheme(name: String): Scheme
fun Scheme(name: String): Scheme

Creates a new instance of Scheme with the given name.

Link copied to clipboard
fun TextData(value: String): TextData
fun TextData(value: String): TextData

Creates a new instance of TextData with the given value.

Link copied to clipboard

Creates a new instance of UrlRequestJob.Options with the given status code and headers.