api

http4k / org.http4k.core / ContentType

ContentType

data class ContentType (source)

Constructors

Name Summary
<init> ContentType(value: String, directive: Pair<String, String>? = null)

Properties

Name Summary
directive val directive: Pair<String, String>?
value val value: String

Functions

Name Summary
toHeaderValue fun toHeaderValue(): String
withNoDirective fun withNoDirective(): ContentType

Companion Object Properties

Name Summary
APPLICATION_FORM_URLENCODED val APPLICATION_FORM_URLENCODED: ContentType
APPLICATION_JSON val APPLICATION_JSON: ContentType
APPLICATION_XML val APPLICATION_XML: ContentType
MULTIPART_FORM_DATA val MULTIPART_FORM_DATA: ContentType
OCTET_STREAM val OCTET_STREAM: ContentType
TEXT_HTML val TEXT_HTML: ContentType
TEXT_PLAIN val TEXT_PLAIN: ContentType
TEXT_XML val TEXT_XML: ContentType

Companion Object Functions

Name Summary
MultipartFormWithBoundary fun MultipartFormWithBoundary(boundary: String): ContentType
Text fun Text(value: String, charset: Charset? = Charsets.UTF_8): ContentType

Extension Functions

Name Summary
with fun <T> T.with(vararg modifiers: (T) -> T): T