This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-30
Channels
- # aleph (4)
- # announcements (5)
- # architecture (1)
- # aws (5)
- # babashka (12)
- # beginners (143)
- # chlorine-clover (4)
- # cider (16)
- # clj-kondo (44)
- # cljfx (26)
- # cljsrn (2)
- # clojure (34)
- # clojure-europe (28)
- # clojure-gamedev (1)
- # clojure-nl (3)
- # clojure-provo (2)
- # clojure-spec (6)
- # clojure-uk (17)
- # clojurescript (99)
- # code-reviews (6)
- # core-async (15)
- # cryogen (9)
- # cursive (14)
- # data-science (1)
- # datomic (16)
- # duct (1)
- # events (4)
- # exercism (1)
- # figwheel-main (3)
- # fulcro (3)
- # hugsql (7)
- # leiningen (4)
- # malli (15)
- # off-topic (13)
- # pathom (8)
- # re-frame (7)
- # reitit (35)
- # remote-jobs (1)
- # sci (10)
- # shadow-cljs (32)
- # sql (5)
- # tools-deps (102)
- # tree-sitter (3)
- # uncomplicate (7)
- # vim (40)
- # xtdb (8)
Hello, I'm wondering if people have recommendations for a straightforward Clojure request library with reasonable async support, along the lines of axios? I'm looking at https://github.com/dakrone/clj-http, I don't know if that's the current state of the art however. Thanks!
Not familiar with Axios, but you might also want to take a look at https://github.com/gnarroway/hato or https://github.com/schmee/java-http-clj for no-dependencies options (if you’re on Java 11+).
Thanks! I'll check those out
@U3Q8MMREX since httpkit is part of babashka, you can also use it in shell scripts. Btw, I enjoyed the podcast interview on defnpodcast a while ago.
oh thanks!
it's funny to be getting back into normal JVM clojure, I've just been in the Arcadia pocket universe for years
I was trying to scrape the Notion API in python and I got really frustrated with the REPL experience. So here I am
Have you used Aleph at all? I was looking at it because I like Zach's libs, it does seem more complicated than http-kit in some ways
had problems with both aleph/http-kit in the past. It was a long time ago for http-kit so maybe it's better now not sure. And aleph the fact it's in life-support + some deadlocks we had makes me reconsider its use
i've also had problems with aleph and http-kit and so would recommend clj-http.. unfortunately http-kit doesn't support true response streaming, it buffers the entire response into a byte array regardless of what you request: https://github.com/http-kit/http-kit/issues/90
I keep hoping someone will remake a clj-http library on top of OkHttp 🙂. maybe one day I can
I wonder why the problem in httpkit isn't fixed yet. One should maybe be able to pass in an object that is compatible with http://clojure.java.io which the response gets written to, without keeping it all in memory. That's the approach I took with babashka/process: https://github.com/babashka/process
Yeah I'm not sure why but it's one of the main reasons I never use it. Anyone have experience reports with https://github.com/schmee/java-http-clj ?
it's quite similar to hato, both are very minimalistic, the java api is not bad at all.
I wrote a super thin wrapper for it as well with our specifics, interceptors at the bottom etc (not on gh for now)
I kind of regret having to make choices of what goes into babashka (right now it contains httpkit since it worked really well with GraalVM), but the Java 11 client space doesn't seem to have a clear winner yet. The java-http library seems simple enough to copy paste and base a babashka.http-client namespace on though, maybe in the future.
hato really didn't work well with GraalVM, since it has all kinds of dynamic require things. the java-http lib pulls in spec in the core namespace which also isn't great, but at least that's easy to get rid off
btw, not async, but I have a very light weight clj-http like wrapper around curl: https://github.com/borkdude/babashka.curl
one cool thing it does is not assuming input/output formats, everything is wired via an interceptor chain, you can use ring1, ring2, or just pain protocol fns depending on the interceptor chain you use with the client. So you can be extremely minimal / low overhead if you need to, or inject some crazy behavior to the chain if you need to
@U050SC7SV Interested in seeing that
that's interesting, what's wrong with pulling in spec @U04V15CAJ?
@U3Q8MMREX I’m reasoning from the perspective of building a GraalVM native image like babashka. Spec doesn’t yield optimal binaries because it has dynamic requires. But this is easy to fix.
I haven’t seen it mentioned here, but we have used aleph
with great success so far. https://github.com/aleph-io/aleph