Elnur Jeksenov
11/18/2020, 5:17 AMAndrew
11/18/2020, 6:13 AMElnur Jeksenov
11/18/2020, 6:41 AMAnimesh Sahu
11/18/2020, 8:18 AMexpect class File { /* Bunch of utility ... */ fun abc(): ReturnType }
It behave similar to interface
In JVM do actual typealias File = <http://java.io|java.io>.File
In iOS or something like that do the same
In native use Posix API and create your own File class implementing actual class File {...}
Elnur Jeksenov
11/18/2020, 11:05 AM<http://httpClient.post|httpClient.post>(url) {
body = MultiPartFormDataContent(
formData {
this.appendInput(
key = "first_file_uploaded",
headers = Headers.build {
append(HttpHeaders.ContentDisposition,
"filename=$fileName")
}
) {
buildPacket { writeFully(byteArray) }
}
}
)
}
kotlinx.serialization.SerializationException: Serializer for class 'MultiPartFormDataContent' is not found.
Mark the class as @Serializable or provide the serializer explicitly.