okhttp / okhttp3 / ResponseBody / create

create

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

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

@JvmStatic fun create(contentType: MediaType?, content: ByteArray): ResponseBody
@JvmStatic fun create(contentType: MediaType?, content: ByteString): ResponseBody
@JvmStatic fun create(contentType: MediaType?, contentLength: Long, content: BufferedSource): ResponseBody

Returns a new response body that transmits content.