Companion

object Companion

Properties

Link copied to clipboard

Empty request body with no content-type.

Functions

Link copied to clipboard
fun <Error class: unknown class>.asRequestBody(contentType: MediaType? = null): RequestBody
fun Path.asRequestBody(fileSystem: FileSystem, contentType: MediaType? = null): RequestBody

Returns a new request body that transmits the content of this.

Link copied to clipboard
fun <Error class: unknown class>.toRequestBody(contentType: MediaType? = null): RequestBody
fun ByteArray.toRequestBody(contentType: MediaType? = null, offset: Int = 0, byteCount: Int = size): RequestBody

Returns a new request body that transmits this.

fun String.toRequestBody(contentType: MediaType? = null): RequestBody

Returns a new request body that transmits this string. If contentType is non-null and lacks a charset, this will use UTF-8.

fun ByteString.toRequestBody(contentType: MediaType? = null): RequestBody