Package-level declarations

Types

Link copied to clipboard
interface Configuration

Configuration for client and server ContentNegotiation plugin

Link copied to clipboard

A custom content converter that could be registered in ContentNegotiation plugin for any particular content type Could provide bi-directional conversion implementation. One of the most typical examples of content converter is a JSON content converter that provides both serialization and deserialization

Link copied to clipboard
open class ContentConvertException(message: String, cause: Throwable? = null) : Exception
Link copied to clipboard
Link copied to clipboard

A custom content converter that could be used in the WebSockets plugin Could provide bi-directional conversion implementation. One of the most typical examples of the content converter is a JSON converter that provides both serialization and deserialization

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
inline suspend fun <T> WebsocketContentConverter.deserialize(content: Frame, charset: Charset = Charsets.UTF_8): T

Deserializes content to the value of type T

suspend fun List<ContentConverter>.deserialize(body: ByteReadChannel, typeInfo: TypeInfo, charset: Charset): Any
Link copied to clipboard
inline suspend fun <T> WebsocketContentConverter.serialize(value: T, charset: Charset = Charsets.UTF_8): Frame

Serializes a value to a WebSocket Frame. This function could throw WebsocketConverterNotFoundException if the value is not suitable for conversion

Link copied to clipboard
fun Headers.suitableCharset(defaultCharset: Charset = Charsets.UTF_8): Charset

Detect suitable charset for an application call by Accept header or fallback to defaultCharset

Link copied to clipboard
fun Headers.suitableCharsetOrNull(defaultCharset: Charset = Charsets.UTF_8): Charset?

Detect suitable charset for an application call by Accept header or fallback to null