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

Big Chungus

09/24/2019, 12:50 PM
How can I send a plain json string from ktor-client-js? Currently it's getting escaped... i.e.:
{"key":123}
is sent as
"{"key":123}"
s

spand

09/24/2019, 12:52 PM
Send a string with content type json
b

Big Chungus

09/24/2019, 12:54 PM
As in
Copy code
httpClient.put<HttpResponse>(url) {
      body = valueJson
      contentType(ContentType.Application.Json)
    }
? this doesn't work
Nvm, solved it:
Copy code
httpClient.put<HttpResponse>(url) {
      body = TextContent(valueJson,ContentType.Application.Json)
    }
👍 1