HttpPlainText

Estimated reading time: 1 minute

This feature processes the request content as plain text of a specified charset by defaultCharset. Also, it will process the response content as plain text too.

This feature is defined in the class io.ktor.client.features.HttpPlainText and no additional artifacts are required.

Install

val client = HttpClient(HttpClientEngine) {
    install(HttpPlainText) {
        defaultCharset = Charsets.UTF_8
    }
}

Bear in mind that the default charset is the JVM’s charset that could be different between systems.
That’s why it is recommended to specify the default charset.