okhttp / okhttp3 / RequestBody / create

create

@JvmStatic fun create(contentType: MediaType?, content: String): RequestBody

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

@JvmStatic fun create(contentType: MediaType?, content: ByteString): RequestBody
@JvmOverloads @JvmStatic fun create(contentType: MediaType?, content: ByteArray, offset: Int = 0, byteCount: Int = content.size): RequestBody

Returns a new request body that transmits content.

@JvmStatic fun create(contentType: MediaType?, file: File): RequestBody

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