1,347 questions
1 vote
1 answer
79 views
How to map numbered JSON fields to a list using Kotlinx Serialization
I’m working with an API (TheMealDB) that returns ingredients in this format: { "strIngredient1": "Salmon", "strIngredient2": "Soy Sauce", "strIngredient3&...
-3 votes
1 answer
48 views
Ktor TCP readbyte [closed]
I would like to ask or assure. If I want to read raw bytes from the tcp connection using ktor in KMP it is not possible or there is no native library function which can help me to read all bytes ...
8 votes
1 answer
229 views
Use zstd compression for a client with Ktor
I'm creating an Android app with Kotlin and I'm using Ktor to transfer data between a client on one device and a server on another one. Ktor offers a plugin to decompress request bodies and to ...
0 votes
0 answers
99 views
Is there a way to configure a "Trust anchor for certification path" in Android Studio?
When trying to connect to the server, receive this kind of error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found At this point in time, it’s not possible ...
0 votes
0 answers
83 views
Kotlin Multiplatform KLIB “duplicate kotlin-stdlib-common” error when running jvmTests in Ktor project
I’m working with the Ktor codebase (3.4.0-SNAPSHOT) and trying to run JVM tests locally. On a clean checkout, recommended testing (per CONTRIBUTING.md) fails: ./gradlew jvmTests The build fails ...
0 votes
0 answers
36 views
How to install RequestValidation plugin in multiple modules
I have a Ktor module that provides a generic feature and I'd like to be able to drop this module into other applications. My generic module has routes and it installs the RequestValidation plugin in ...
3 votes
0 answers
205 views
Objectify with Kotlin Ktor 3.3
Objectify v6.1.3 With Kotlin and Ktor 3.1, I was calling ObjectifyService.begin() within the init {} block of my request handler base class and then closing that context once the request was finished. ...
0 votes
0 answers
83 views
DiskReadViolation on Ktor with json negotiation
My StrickMode and Ktor HttpClient setup on Android import io.ktor.client.plugins.contentnegotiation.ContentNegotiation import io.ktor.serialization.kotlinx.json.json override fun onCreate(...
0 votes
1 answer
439 views
How to intercept responses using Ktor on Android
I'm an Android developer. I'm using Retrofit and had previously created an interceptor for testing purposes. It intercepts cases that are difficult to reproduce in the actual production environment ...
0 votes
1 answer
78 views
How to send a file using ktor-client to R2 with `application/octet-stream` header?
I am trying to make PUT-request to r2.cloudflarestorage.com to upload a file like this: curl --location --request PUT 'https://*.r2.cloudflarestorage.com/***' \ --header 'Content-Type: application/...
0 votes
1 answer
64 views
How to log to separate ALL and INFO KTOR level files?
I basically would like to have one file using install(Logging) { level = LogLevel.ALL } And another using install(Logging) { level = LogLevel.INFO } (everything else stays equal) My attempts:...
0 votes
1 answer
68 views
ktor client to download gripped XML
I am trying to download https://aviationweather.gov/data/cache/metars.cache.xml.gz but there headers are a bit funny. They basically respond with a header content-type: application/x-gzip I think the ...
4 votes
2 answers
293 views
Error with Ktor and Exposed with LocalDate field in Postgres (ClassNotFoundException: kotlinx.datetime.Instant)
I have a small test table in Postgres with a DATE field, and data class in Ktor app. When mapping the database table row result to TestItem the 'updated' LocalDate field generated the error. import ...
0 votes
0 answers
127 views
Ktor client 3.2.0+ causes first authenticated call to return 400 Bad Request
If I login normally and then call an endpoint, it works fine. (Yes login as first call works fine) If I restart the app, fetch the stored token from SharedPreferences and make the same request — it ...
0 votes
0 answers
285 views
java.io.EOFException or Content-Length mismatch when using Ktor CIO engine after BouncyCastle FIPS update
After upgrading BouncyCastle dependencies from: org.bouncycastle:bc-fips:2.0.0 → 2.1.0 org.bouncycastle:bctls-fips:2.0.19 → 2.1.20 I started encountering issues when using the Ktor CIO client engine. ...