4

Ktor's HttpClient allows installing a Json feature. Does anyone know if this feature can use kotlinx.serialization library or is it only limited to Gson? I'm interested in enabling the Json feature for MPP projects.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Y2i
  • 3,748
  • 2
  • 28
  • 32
  • I think there was a discussion about it on Slack. It's possible, but someone would have to write an implementation. Please give it a go. – avolkmann Oct 05 '18 at 12:56

1 Answers1

8

Yep. There is kotlinx.serialization support in JsonFeature

http://ktor.io/clients/http-client/features/json-feature.html#kotlinx-serialization

For the advance multiplatform example of the ktor client with kotlinx.serialization you could look into: https://github.com/JetBrains/kotlinconf-app

Leonid
  • 455
  • 2
  • 8