Another question on the above - If I want to have ...
# http4k
m
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
You can with something like:
Copy code
val signatureRequired = MultipartFormField.string().boolean().required("signatureRequired")
m
oooh, very nice. Thanks