https://kotlinlang.org logo
#http4k
Title
# http4k
m

MrNiamh

12/06/2021, 3:11 PM
Another question on the above - If I want to have a separate body along with the file (e.g. I want to upload a file, along with its visibility, and if a signature is required), that’s not possible is it? It would have to be:
Copy code
val imageFile = MultipartFormFile.required("inputFile")
val visibility = MultipartFormField.string().required("visibility")
val signatureRequired = MultipartFormField.string().required("signatureRequired")

val strictFormBody = Body.multipartForm(Validator.Strict, imageFile, visibility, signatureRequired, diskThreshold = 5).toLens()
And if that’s the case, is there no way to show through the api docs that
signatureRequired
is a boolean? Just want to make sure i’m doing it correctly
s

s4nchez

12/06/2021, 3:38 PM
You can with something like:
Copy code
val signatureRequired = MultipartFormField.string().boolean().required("signatureRequired")
m

MrNiamh

12/06/2021, 3:48 PM
oooh, very nice. Thanks
3 Views