Hi, I am trying to compress the body of a request ...
# ktor
f
Hi, I am trying to compress the body of a request I am sending from client written with Ktor. I have added the encoding plugin:
Copy code
implementation("io.ktor:ktor-client-encoding:$ktorVersion") // ktorVersion=2.3.8
I configured compression in my client:
Copy code
private val client = HttpClient(CIO){
        install(ContentEncoding) {
            deflate(1.0F)
            gzip(0.9F)
        }
    }
However I cannot import the
compress
extension method presented here: https://api.ktor.io/ktor-client/ktor-client-plugins/ktor-client-encoding/io.ktor.client.plugins.compression/compress.html Do you have any idea why is this the case?
a
The
HttpRequestBuilder.compress
has been introduced in Ktor
3.0.0-beta-1
, so Ktor
2.3.8
doesn't have it. For some reason this method is included in the Ktor 2.3.8 API documentation.
f
Oh, I see, thank you