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

Vivek Modi

04/11/2022, 3:41 PM
Hey I want to understand, what is the use of this
ContentNegotiation
in ktor in client side? Can someone guide me.
a

Aleksei Tirman [JB]

04/11/2022, 3:42 PM
To serialize/deserialize HTTP body based on the
Content-Type
header.
v

Vivek Modi

04/11/2022, 3:42 PM
okk got it
a

Aleksei Tirman [JB]

04/11/2022, 3:43 PM
m

Marko Novakovic

04/11/2022, 3:51 PM
implementation("io.ktor:ktor-client-content-negotiation:2.0.0")
and you install it like so:
import io.ktor.client.plugins.contentnegotiation.*
Copy code
install(ContentNegotiation) {
    json(
        Json { ... }
    )
}
4 Views