Hi all. When I upload a jpeg via curl, the content-type gets set to image/jpeg.
curl -L -X POST "<https://my/url/>" -F 'file=@mypic.jpg'
but when I upload via clj-http:
(client/post "<https://my/url/>" {:multipart
[{:name "file" :content (<http://clojure.java.io/file|clojure.java.io/file> "mypic.jpg")}]})
the file winds up as application/octet-stream. I have tried everything I can think of to specify the content type e.g. adding {:name “Content/type” :content “image/jpeg”} to the multipart vector, but to no avail.
Any idea how to emulate the curl behavior here, and have the content type set correctly on file uploads?
Thanks!Set this
[{:name "file" :content (<http://clojure.java.io/file|clojure.java.io/file> "mypic.jpg") :mime-type "image/jpeg"}]})
@dharrigan That worked!! Thank you!
You're most welcome 😉