https://kotlinlang.org logo
#ktor
Title
# ktor
v

Viktor Orlyk

04/17/2022, 8:10 AM
Can someone please help me with understanding what is wrong with my response parsing in ktor https://stackoverflow.com/questions/71900269/ktor-failing-to-parse-response-no-transformation-found-class-io-ktor-utils-io-b
Copy code
val client = HttpClient(CIO) {
            install(ContentNegotiation) {
                json(Json {
                    prettyPrint = true
                    isLenient = true
                })
            }
        }
my ide shows an error in there
Copy code
'fun <P : Pipeline<*, ApplicationCall>, B : Any, F : Any> Application.install(plugin: Plugin<Application, ContentNegotiationConfig, PluginInstance>, configure: ContentNegotiationConfig.() -> Unit = ...): PluginInstance' can't be called in this context by implicit receiver. Use the explicit one if necessary
a

Aleksei Tirman [JB]

04/17/2022, 8:13 AM
Please check packages of
ContentNegotiation
for both client and server.
Maybe, you imported a wrong dependency.
v

Viktor Orlyk

04/17/2022, 8:16 AM
@Aleksei Tirman [JB] I have installed both
Copy code
implementation("io.ktor:ktor-server-content-negotiation:$ktor_version")
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktor_version")
a

Aleksei Tirman [JB]

04/17/2022, 8:16 AM
I see only for the server here
👍 1
v

Viktor Orlyk

04/17/2022, 8:25 AM
yeah my bad. will post final code in stack overflow so maybe other can read what’s wrong)
5 Views