https://kotlinlang.org logo
Title
w

wollnyst

01/27/2019, 2:29 PM
How can I set an instance of
kotlinx.serialization.json.JsonObject
as body on a ktor-client? The following calls fails with
kotlinx.serialization.SerializationException: Can't locate argument-less serializer for class kotlinx.serialization.json.JsonObject
kotlin
  val client = HttpClient(OkHttp) {
      install(JsonFeature) {
          serializer = KotlinxSerializer(JSON.nonstrict)
      }
  }
  <http://client.post|client.post><Unit>(url) {
      body = json { "hello" to "world" }

  }
e

e5l

01/28/2019, 8:05 AM
@sandwwraith
w

wollnyst

01/28/2019, 2:16 PM
ah thanks, looking forward to the next release