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

Evan

12/10/2020, 7:34 PM
Hey all, I’m using ktor in a KMP project that mainly interacts with a .NET server. All of the API operations are using content type
application/json
and the KotlinX serializer / JsonFeature, except for one. On one endpoint, I have to upload file content with a
multipart/form-data
request, that expects an
application/json
response. When I try to set the header on that request, it gives an error that the ktor engine is supposed to control the content type. Is there a way to override that behavior, or will I have to create a new HttpClient without the JsonFeature installed?
Further, I cannot set that header at ALL if I install the logging feature. This seems like a huge flaw, or else I’m not using this correctly.
tried updating to the latest 1.4.3 release and updated Android Studio as well… Now all Ktor syntax highlighting is broken, can’t find the imports, but it still builds….
2 Views