Hi there! Do any of you know how can I use `call.r...
# ktor
a
Hi there! Do any of you know how can I use
call.receiveParameters()
when I use the content negotiation module? I get
Copy code
kotlinx.serialization.SerializationException: Can't locate argument-less serializer for class Parameters. For generic classes, such as lists, please provide serializer explicitly.
How do I provide a serializer for Parameters? Or a Map? I'm using the kotlinx.serialization serializer like this:
Copy code
import io.ktor.application.Application
import io.ktor.application.install
import io.ktor.features.ContentNegotiation
import io.ktor.serialization.json

fun Application.configureContentNegotiation() {
    install(ContentNegotiation) {
        json()
    }
}
I also checked the docs but I did not find any examples for this.
t
In my case, I did the following and it worked.
Copy code
install(ContentNegotiation) {
    json(
            json = Json(configuration = DefaultJsonConfiguration.copy(prettyPrint = true)),
            contentType = ContentType.Application.Json
    )
}
👍 1
a
This is great, thanks!
🎉 1