mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-09-20 17:46:10 +00:00
16 lines
400 B
Kotlin
16 lines
400 B
Kotlin
package dev.inmo.micro_utils.ktor.server
|
|
|
|
import io.ktor.server.application.ApplicationCall
|
|
import io.ktor.server.response.responseType
|
|
import io.ktor.util.InternalAPI
|
|
import io.ktor.util.reflect.TypeInfo
|
|
|
|
@InternalAPI
|
|
suspend fun <T : Any> ApplicationCall.respond(
|
|
message: T,
|
|
typeInfo: TypeInfo
|
|
) {
|
|
response.responseType = typeInfo
|
|
response.pipeline.execute(this, message as Any)
|
|
}
|