dakrone / clj-http

An idiomatic clojure http client wrapping the apache client. Officially supported version.
http://clojars.org/clj-http
MIT License
1.77k stars 408 forks source link

multipart posts: sending name requires a mime-type #634

Open ejschoen opened 1 year ago

ejschoen commented 1 year ago

I wonder if this is worth documenting in the README for Multipart posts: Due to the design of the Filebody constructor, a File part in a multipart post won't send with the value of the :name key(i.e., filename) unless the part map also has :mime-type. The README has an example for a part value that's something like {:name ... :content (io/as-file ...)} that doesn't actually do what the example hints, since it doesn't send the name, only the part-name, in this case.