Fork me on GitHub

Hello! I'm trying to make a HTTP post request using joker.http/send but I'm not figured out yet how to pass the parameters into the :body request map value... has anyone an example of that?


In another words -> how to convert a regular Clojure map into a valid content to :body map value?


:body is just a string that can be whatever you want it to be


if you want to convert a map to JSON encoded string, look at joker.json namespace.


Have you checked out joker.hiccup/html?


The latest version, just pushed, squeezes another 2ms or so out of startup time on my MacBook Pro (OS X), though it's barely measurable as an improvement on my Ryzen 3: Build via ./ as usual; the resulting joker executable, also named (via hardlink), is the fast-startup version, while joker.slow is the normal version. I hope to make this PR-able by next Thursday, possibly sooner. Needs more cleanup, but the list of known optimizations to pursue is now empty. (The list could start growing again if somebody analyzes why it's still 2.5x or so slower starting up than a simply command-line-echo program written in Go.) Enjoy!


Wouldn't the interpretation mean it can never be as fast as Go ?


James is referring to start up time, not the actual execution speed.

👍 8

Where are we in terms of a REPL (preferably from Cursive)? I'm working on some tricky stuff and decided to develop it in Clojure in Cursive, then copy-and-paste into my Joker code.


Cursive can now do Socket REPL but still isn't able to evaluate forms in the Joker REPL. I can see them both connecting. Perhaps you have better luck!


Of course, it is awesome that you can do that!


[ANN] multi 1.1.0 I've enhanced multi with a new defcommand macro that eliminates a lot of tedium in writing commands.

(multi/defcommand configure
  "Configures the system with keys and values"
  [verbose ["-v" "--verbose" "Enable verbose logging"]
   host ["HOST" "System configuration URL"
         :validate [#(re-matches #"https?://.+" %) "must be a URL"]]
   key-values ["DATA" "Data to configure as KEY=VALUE"
               :parse-fn (fn [s]
                           (when-let [[_ k v] (re-matches #"(.+)=(.+)" s)]
                             [(keyword k) v]))
               :update-fn (fn [m [k v]]
                            (assoc m k v))
               :repeatable true]]
  (do-configure host key-values {:verbose verbose}))

👍 4