It looks like file name is conflated a bit in ->multipart-body. The file-name is optional yet it's always set to name. The field name and filename should be treated as separate entities. Does something like this seem reasonable?
(doseq [{:keys [name content part-name mime-type file-name]} parts]
(.addFormDataPart builder (or part-name name) file-name (->request-body mime-type content)))
This allows us to set the name to something like "image" and file-name to something like "my-image.jpg" a bit more easily or simply omit the filename if we don't have one.
It looks like file name is conflated a bit in ->multipart-body. The file-name is optional yet it's always set to
name. The field name and filename should be treated as separate entities. Does something like this seem reasonable?This allows us to set the name to something like "image" and file-name to something like "my-image.jpg" a bit more easily or simply omit the filename if we don't have one.