This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-03-07
Channels
- # announcements (1)
- # architecture (9)
- # babashka (3)
- # calva (10)
- # clj-http (13)
- # clj-kondo (11)
- # clojure (23)
- # clojure-europe (11)
- # clojure-nl (1)
- # clojure-norway (112)
- # clojure-uk (4)
- # clojuredesign-podcast (8)
- # clojurescript (10)
- # core-async (5)
- # cursive (7)
- # data-science (15)
- # datascript (2)
- # datomic (29)
- # emacs (5)
- # events (1)
- # hugsql (1)
- # hyperfiddle (9)
- # midje (1)
- # missionary (3)
- # music (1)
- # off-topic (34)
- # polylith (1)
- # re-frame (16)
- # shadow-cljs (117)
- # squint (19)
- # yamlscript (1)
#clj-http
<
2024-03-07I'm converting from hato to clj-http (don't ask), and multipart is not working for me no matter what I do
In hato, it's just :multipart [{:name "request_body" :content-type "form-data" :content (json/encode body)}]
in clj-http im trying: :multipart [{:name "request_body" :content (json/encode body) :encoding "UTF-8" :mime-type "form-data"}]
This works for me:
(http/post url
{:client client
:headers {"Accept" "application/json"
...}
:multipart [{:name "file" :content content
:file-name filename}]})
I just set it to the filename of the file I am sending in the content. It is just the filename not the path.
I may have answered incorrectly as I was using clj-http - and moved to use babashka.http-client as I am using bb. Sorry, I may not be the best to answer this.