Robert Jaros
08/24/2026, 5:08 PMApache engine to Apache5 with Ktor 3.5.2 client, my requests are failing with Content-Length mismatch: expected 5696 bytes, but received 20120 bytes error. I see some old similar bugs (e.g. KTOR-7934) but I'm on the latest version and on the JVM. It looks like some problem with gzip but I'm sure my server is sending correctly gzipped data.Bruce Hamilton
08/24/2026, 5:22 PMgpopides
08/24/2026, 5:23 PMcustomizeClient { disableContentCompression() } in a jvm backend tooRobert Jaros
08/24/2026, 5:40 PMRobert Jaros
08/24/2026, 5:42 PMRobert Jaros
08/25/2026, 9:27 AMRobert Jaros
08/25/2026, 9:28 AMplugins {
kotlin("jvm") version "2.4.10"
id("org.springframework.boot") version "4.1.1"
}
group = "com.example"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
implementation("io.ktor:ktor-client-core:3.5.2")
implementation("io.ktor:ktor-client-apache5:3.5.2")
implementation("io.ktor:ktor-client-content-negotiation:3.5.2")
implementation("io.ktor:ktor-serialization-kotlinx-json:3.5.2")
implementation(platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES))
}
kotlin {
jvmToolchain(25)
}Robert Jaros
08/25/2026, 9:29 AMsuspend fun main() {
val httpClient = HttpClient(Apache5) {
install(ContentNegotiation) {
json()
}
}
httpClient.get("<https://www.google.com>").bodyAsText()
}Robert Jaros
08/25/2026, 9:34 AM5.5.1 while Spring BOM is forcing 5.6.4Robert Jaros
08/25/2026, 9:36 AMBruce Hamilton
08/25/2026, 9:40 AMRobert Jaros
08/25/2026, 9:40 AMimplementation("org.apache.httpcomponents.client5:httpclient5:5.6.4") instead of Spring BOM breaks Ktor as well.Robert Jaros
08/25/2026, 9:42 AMSupport for transparent content decompression and content compression with deflate, gzip, zstd (optional), and brotli (optional) codecs in the async transport.Robert Jaros
08/25/2026, 9:42 AMRobert Jaros
08/25/2026, 9:44 AMBruce Hamilton
08/25/2026, 9:46 AM