This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-02
Channels
- # announcements (2)
- # beginners (69)
- # boot (1)
- # cider (35)
- # clara (1)
- # cljs-dev (1)
- # clojure (40)
- # clojure-spec (11)
- # clojure-uk (8)
- # clojurescript (9)
- # cursive (1)
- # datomic (5)
- # figwheel-main (25)
- # fulcro (64)
- # jobs (2)
- # jukebox (1)
- # kaocha (3)
- # off-topic (7)
- # pathom (39)
- # planck (5)
- # random (1)
- # re-frame (11)
- # reagent (8)
- # shadow-cljs (58)
- # test-check (41)
- # vim (13)
I'm trying to adjust settings on ElasticSearch with Planck. ElasticSearch wants a JSON blob on a PUT request. How would I format this appropriately with planck.http/put
?
This is the curl equivalent:
curl -XPUT '' -d '{… blob …}'
@henrik If you do the following curl
command (specifying JSON content type)
curl -XPUT '' -H "Content-Type: application/json" -d '{:foo 1}'
then the equivalent in Planck would be:
(planck.http/put "" {:content-type "application/json" :body "{foo: 1}"})
Otherwise, curl
is actually sending a content-type of application/x-www-form-urlencoded
, and in that case a curl
request like
curl -XPUT '' -d 'foo=1'
has the following equivalent in Planck:
(http/put "" {:form-params {:foo 1}})
(But I suspect you really want to work with JSON given your description.)