clj-http 2020-10-25

@mchampine has joined the channel

Hi all. When I upload a jpeg via curl, the content-type gets set to image/jpeg.

curl -L -X POST "" -F 'file=@mypic.jpg'
but when I upload via clj-http:
(client/post "" {:multipart
             [{:name "file" :content ( "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!

[{:name "file" :content ( "mypic.jpg") :mime-type "image/jpeg"}]})

@dharrigan That worked!! Thank you!

You're most welcome 😉