Код: Выделить всё
httpClient.submitFormWithBinaryData(
url = ApiConstants.SETTING_POS_PHOTO_UPLOAD,
formData = formData {
append("serial_number", SK210Manager.getSerialNumber())
appendInput(
"photo", headers = Headers.build {
append(HttpHeaders.ContentType, uploadPhotoRequest.contentType)
append(
HttpHeaders.ContentDisposition,
"filename=${TransactionDetails.imageFileName}"
)
},
size = uploadPhotoRequest.file.size.toLong()
) {
buildPacket {
writeFully(uploadPhotoRequest.file)
}
}
}) {
}
class UploadPhotoRequest(
val cashlessId = "1111",
val file: ByteArray,
val contentType = "image/jpg",)
Подробнее здесь: https://stackoverflow.com/questions/793 ... ption-unex
Мобильная версия