ContentType
class ContentType : HeaderValueWithParameters
Represents a value for a Content-Type
header.
Types
object Application Provides a list of standard subtypes of an |
|
object Audio Provides a list of standard subtypes of an |
|
object Image Provides a list of standard subtypes of an |
|
object Message Provides a list of standard subtypes of a |
|
object MultiPart Provides a list of standard subtypes of a |
|
object Text Provides a list of standard subtypes of a |
|
object Video Provides a list of standard subtypes of a |
Constructors
ContentType( |
Properties
val contentSubtype: String represents a subtype part of the media type. |
|
val contentType: String represents a type part of the media type. |
Inherited Properties
val content: String header’s content without parameters |
|
val parameters: List<HeaderValueParam> |
Functions
fun hashCode(): Int |
|
fun match(pattern: ContentType): Boolean Checks if |
|
fun withParameter(name: String, value: String): ContentType Creates a copy of |
|
fun withoutParameters(): ContentType Creates a copy of |
Inherited Functions
The first value for the parameter with name comparing case-insensitively or |
|
open fun toString(): String |
Companion Object Properties
val Any: ContentType Represents a pattern |
Companion Object Functions
fun parse(value: String): ContentType Parses a string representing a |
Extension Functions
fun HeaderValueWithParameters.charset(): Charset? Extracts a Charset value from the given |
|
fun ContentType.fileExtensions(): List<String> Recommended file name extensions for this content type |
|
fun ContentType.withCharset(charset: Charset): ContentType Creates a copy of |
Companion Object Extension Functions
fun ContentType.Companion.defaultForFile( fun ContentType.Companion.defaultForFile( |
|
fun ContentType.Companion.defaultForFileExtension( Default ContentType for extension |
|
fun ContentType.Companion.defaultForFilePath( Default ContentType for file path |
|
fun ContentType.Companion.fromFileExtension( Recommended content type by file name extension |
|
fun ContentType.Companion.fromFilePath( Recommended content types by file path |