Skip to content

//okhttp/okhttp3/MediaType/Companion

Companion

[common]\ expect object Companion

[jvm, nonJvm]\ actual object Companion

Functions

Name Summary
toMediaType [common]
expect fun String.toMediaType(): MediaType
Returns a media type for this string.
[jvm, nonJvm]
[jvm]
@JvmStatic
@JvmName(name = "get")
actual fun String.toMediaType(): MediaType
[nonJvm]
actual fun String.toMediaType(): MediaType
toMediaTypeOrNull [common]
expect fun String.toMediaTypeOrNull(): MediaType?
Returns a media type for this, or null if this is not a well-formed media type.
[jvm, nonJvm]
[jvm]
@JvmStatic
@JvmName(name = "parse")
actual fun String.toMediaTypeOrNull(): MediaType?
[nonJvm]
actual fun String.toMediaTypeOrNull(): MediaType?