This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-24
Channels
- # aleph (1)
- # babashka (2)
- # beginners (25)
- # calva (5)
- # cider (8)
- # cljdoc (4)
- # clojure (81)
- # clojure-europe (41)
- # clojure-spec (11)
- # clojurescript (7)
- # conjure (1)
- # data-science (1)
- # datomic (25)
- # defnpodcast (3)
- # events (2)
- # figwheel-main (8)
- # fulcro (5)
- # helix (4)
- # hugsql (1)
- # java (2)
- # off-topic (35)
- # onyx (18)
- # pathom (8)
- # rdf (5)
- # re-frame (9)
- # reagent (3)
- # reitit (1)
- # shadow-cljs (39)
- # tools-deps (53)
- # xtdb (23)
Hello. Can you recommend some http client that works nicely with re-frame/cljs?
https://github.com/day8/re-frame-http-fx for re-frame. It wraps cljs-ajax which you can use directly if you're not using re-frame.
Yes, that's what I am using currently. Unfortunately it returns response body only and I haven't found a good way to extract the whole response with status code and headers and such. Unless you know how to do it right in re-frame ;) I'm still learning so sorry if the question is obvious.
Other than that, I think http-fx is pretty cool
Seems like specifying (ajax.ring/ring-response-format)
as the response format might get you the headers and the status code. I haven't tried it though.
Okay, thank you very much. I will try it out 👍
@U2FRKM4TW Thanks for setting me up on the right track. I ended up using:
:response-format (ajax/ring-response-format {:format (ajax/json-response-format)})
Though I must say the documentation for it which says "`ring-response-format` takes one parameter: format
" is not the same as "takes one paramater, which is a map that accepts one key only, i.e. :format
that has to be one of response-formats listed earlier"...
Anyway, thanks a lot 🙏Source code is always the answer. :) More often with time I tend to consult it before the documentation.
Yeah... I'm still getting accustomed to clj code but I was so frustrated that such an obvious thing took me 2 days...