This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-28
Channels
- # adventofcode (2)
- # announcements (4)
- # babashka (34)
- # beginners (44)
- # biff (5)
- # calva (8)
- # cider (4)
- # clj-kondo (5)
- # clj-on-windows (5)
- # clojure (57)
- # clojure-art (1)
- # clojure-denmark (2)
- # clojure-europe (40)
- # clojure-nl (1)
- # clojure-norway (6)
- # clojure-seattle (1)
- # clojure-uk (2)
- # clojurescript (20)
- # cursive (6)
- # datomic (1)
- # emacs (6)
- # events (5)
- # fulcro (22)
- # helix (5)
- # hyperfiddle (5)
- # jobs (1)
- # joyride (2)
- # lsp (8)
- # malli (8)
- # off-topic (30)
- # pathom (8)
- # pedestal (1)
- # portal (5)
- # proton (1)
- # rdf (2)
- # re-frame (4)
- # releases (1)
- # remote-jobs (1)
- # reveal (8)
- # xtdb (5)
Hi, I am re-frame noob and wondering how to make a request to the backend with body part. Using this example from https://github.com/day8/re-frame-http-fx
(re-frame/reg-event-fx
::http-post
(fn [_world [_ val]]
{:http-xhrio {:method :post
:uri ""
:params data
:timeout 5000
:format (ajax/json-request-format)
:response-format (ajax/json-response-format {:keywords? true})
:on-success [::success-post-result]
:on-failure [::failure-post-result]}}))
When the backend expects a clojure map for the body, can I pass it here in data
at params
field? Or maybe somewhere else.The :params
will be sent according to the :method
and :format
. In your example, data
will be JSON-encoded and send as the body of the POST request.
💯 1
> When the backend expects a clojure map for the body Does that mean that the backend expects the body in EDN format?