Lawrence
07/14/2022, 8:31 PMcurl -X POST \
$url \
-H "Accept: application/json" \
-H "Content-Type: application/octet-stream" \
--data-binary "@$FILE"
i tried sending the file as body but I quickly ran out of memory with setBody(file.readBytes()
. Is there a streaming implementation without using MultiPartForm?ephemient
07/14/2022, 8:36 PMAleksei Tirman [JB]
07/15/2022, 4:26 AMval client = HttpClient(Apache)
val response = <http://client.post|client.post>(url) {
header(HttpHeaders.Accept, ContentType.Application.Json)
contentType(ContentType.Application.OctetStream)
setBody(FILE.readChannel())
}