You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a use-case like this: I need to talk JSON but there are keys in the third-party JSON payloads which are not keywordizable.
Currently (I think) this means that I can't use the niceties of the cljs-http.client namespace, which I was using extensively, because :keywordize-keys true is baked in to the json-response middleware included there.
Would it be possible / practical / a good thing for users to be able to somehow modify this default middleware? So that, for instance, I could do something like this:
Hi Murphy,
I think the best way would be to make this configurable as a parameter to
wrap-json-response and then build your own client with the stuff you need.
I am aware that the get/post etc fns are tied to the default client. I
think those fns should be changed so you can pass a client as the first
parameter. Because of that I usually just call the request fn and use a map
as arguments, and don't use those fns at all. It's a bit of a relict trying
to have the same api as clj-http. I would like to improve this in the
future. Unfortunately I'm on a surf trip at the moment and AFK most of the
time. If you can send a PR with the changes to wrap-json-response I would
merge that.
Roman
On 29 Oct 2015 4:53 p.m., "Murphy McMahon" [email protected] wrote:
I have a use-case like this: I need to talk JSON but there are keys in the
third-party JSON payloads which are not keywordizable.
Currently (I think) this means that I can't use the niceties of the
cljs-http.client namespace, which I was using extensively, because :keywordize-keys
true is baked in to the json-response middleware included there.
Would it be possible / practical / a good thing for users to be able to
somehow modify this default middleware? So that, for instance, I could do
something like this:
I have a use-case like this: I need to talk JSON but there are keys in the third-party JSON payloads which are not keywordizable.
Currently (I think) this means that I can't use the niceties of the
cljs-http.client
namespace, which I was using extensively, because:keywordize-keys true
is baked in to the json-response middleware included there.Would it be possible / practical / a good thing for users to be able to somehow modify this default middleware? So that, for instance, I could do something like this:
Or is that a terrible idea? Thanks for listening!
The text was updated successfully, but these errors were encountered: