receive

open suspend fun <T> receive(typeInfo: TypeInfo): T(source)

Receives content for this request according to typeInfo.

This function returns null only when TypeInfo.isNullable is true. The caller is responsible for ensuring that typeInfo represents the same type as T. Receive operations for the same call must be sequential and must not be started from an ApplicationReceivePipeline interceptor.

Report a problem

Return

an instance of T received from this call.

Parameters

typeInfo

instance specifying the type to be received.

Throws

when content cannot be transformed to the requested type.

when another receive operation is in progress for this call.