receiveOrNull

inline suspend fun <T : Any> ApplicationCall.receiveOrNull(): T?

Deprecated

receiveOrNull is ambiguous with receiveNullable and going to be removed in 3.0.0. Please consider replacing it with runCatching with receive or receiveNullable

Replace with

kotlin.runCatching { this.receiveNullable<T>() }.getOrNull()

Receives content for this request.

Return

instance of T received from this call, or null if content cannot be transformed to the requested type.


suspend fun <T : Any> ApplicationCall.receiveOrNull(typeInfo: TypeInfo): T?

Deprecated

receiveOrNull is ambiguous with receiveNullable and going to be removed in 3.0.0. Please consider replacing it with runCatching with receive or receiveNullable

Replace with

kotlin.runCatching { this.receiveNullable<T>() }.getOrNull()

Receives content for this request.

Return

instance of T received from this call, or null if content cannot be transformed to the requested type.

Parameters

typeInfo

type to be received.


suspend fun <T : Any> ApplicationCall.receiveOrNull(type: KClass<T>): T?

Deprecated

receiveOrNull is ambiguous with receiveNullable and going to be removed in 3.0.0. Please consider replacing it with runCatching with receive or receiveNullable

Replace with

kotlin.runCatching { this.receiveNullable<T>() }.getOrNull()

Receives content for this request.

Return

instance of T received from this call, or null if content cannot be transformed to the requested type..

Parameters

type

instance of KClass specifying type to be received.