mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-12-18 14:47:15 +00:00
fixes
This commit is contained in:
parent
3f6f6ebc2b
commit
47b0f6d2d8
@ -17,8 +17,11 @@ import io.ktor.http.HttpStatusCode
|
|||||||
import io.ktor.http.Parameters
|
import io.ktor.http.Parameters
|
||||||
import io.ktor.http.content.PartData
|
import io.ktor.http.content.PartData
|
||||||
import kotlinx.serialization.DeserializationStrategy
|
import kotlinx.serialization.DeserializationStrategy
|
||||||
|
import kotlinx.serialization.InternalSerializationApi
|
||||||
|
import kotlinx.serialization.SerializationStrategy
|
||||||
import kotlinx.serialization.StringFormat
|
import kotlinx.serialization.StringFormat
|
||||||
import kotlinx.serialization.encodeToString
|
import kotlinx.serialization.encodeToString
|
||||||
|
import kotlinx.serialization.serializer
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -29,6 +32,7 @@ import java.io.File
|
|||||||
* in case you wish to pass other source of multipart binary data than regular file
|
* in case you wish to pass other source of multipart binary data than regular file
|
||||||
* @suppress
|
* @suppress
|
||||||
*/
|
*/
|
||||||
|
@OptIn(InternalSerializationApi::class)
|
||||||
actual suspend fun <T> HttpClient.uniUpload(
|
actual suspend fun <T> HttpClient.uniUpload(
|
||||||
url: String,
|
url: String,
|
||||||
data: Map<String, Any>,
|
data: Map<String, Any>,
|
||||||
@ -60,7 +64,7 @@ actual suspend fun <T> HttpClient.uniUpload(
|
|||||||
)
|
)
|
||||||
else -> append(
|
else -> append(
|
||||||
k,
|
k,
|
||||||
stringFormat.encodeToString(v)
|
stringFormat.encodeToString(v::class.serializer() as SerializationStrategy<in Any>, v)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user