receiveOrNull

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

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(
    type: KClass<T>
): T?

Receives content for this request.

Parameters

type - instance of KClass specifying type to be received.

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