This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-07
Channels
- # adventofcode (202)
- # aleph (8)
- # announcements (13)
- # architecture (1)
- # aws (2)
- # beginners (201)
- # boot (1)
- # bristol-clojurians (1)
- # calva (2)
- # cider (23)
- # cljs-dev (22)
- # cljsrn (2)
- # clojure (105)
- # clojure-bangladesh (1)
- # clojure-berlin (8)
- # clojure-dev (104)
- # clojure-europe (3)
- # clojure-italy (5)
- # clojure-losangeles (1)
- # clojure-nl (24)
- # clojure-russia (55)
- # clojure-spec (44)
- # clojure-uk (19)
- # clojurescript (58)
- # component (58)
- # cursive (3)
- # data-science (1)
- # datomic (27)
- # duct (6)
- # events (6)
- # figwheel-main (6)
- # fulcro (15)
- # jobs (3)
- # kaocha (5)
- # luminus (1)
- # music (1)
- # nrepl (2)
- # off-topic (24)
- # onyx (1)
- # pedestal (3)
- # protorepl (8)
- # re-frame (18)
- # reagent (39)
- # reitit (1)
- # remote-jobs (1)
- # ring (15)
- # rum (11)
- # shadow-cljs (5)
- # sql (8)
- # tools-deps (12)
- # vim (7)
There is a helper to make {:foo "bar"}
=> foo=bar
to turn form-params
into a "body string"?
I think that I need a example of pedestal.test/response-for
doing a HTTP POST with form-params
here’s my rough example using peridot to construct the multipart headers and body
(require '[peridot.multipart :as multipart])
(let [{:keys [body headers]} (multipart/build {:graphic (io/file "foo.bar")
:user-id 1})
{:keys [status body headers]} (-> (::http/service-fn (http/create-servlet server/config))
(response-for :post "/notes"
:body body
:headers headers)
(decode))]
(is (= 201 status))
(is (= foo body)))
👍 4