I got java.net.ProtocolException: unexpected end of stream when try to upload img file to server
val response = httpClient.submitFormWithBinaryData(
url = BASE_URL + "files/upload",
formData = formData {
append("image", file!!.readBytes(), Headers.build {
append(HttpHeaders.ContentType, "image/png")
append(HttpHeaders.ContentDisposition, "filename=\"ktor_logo.png\"")
})
}
)
How to solve that ?