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 👍
@p-himik 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...