toRequestBody

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


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.