Plug Serialization into Ktor
Install ContentNegotiation for automatic decoding.
Stop Parsing by Hand
You could decode every response manually, but Ktor can wire serialization in so requests and replies become typed automatically.
Meet ContentNegotiation
The ContentNegotiation plugin teaches the HttpClient how to convert request and response bodies to and from your models.
All lessons in this course
- @Serializable Data Models
- @SerialName & Custom Field Mapping
- Nullable, Default & Optional Fields
- Plug Serialization into Ktor