r0man / cljs-http

A ClojureScript HTTP library.
582 stars 93 forks source link

Mangled JSON replies #132

Closed rpompen closed 2 years ago

rpompen commented 2 years ago

Although the library works fine for simple situations, I'm now confronted with the inability to properly use a database.

It returns JSON keys with spaces in them. cljs-http tries to convert this into keywords (But why? JSON keys are strings, strings are not idempotent with keywords).

Is there a way to deactivate keywordization that I'm not aware of?

Regards,

Roel Pompen

fversnel commented 2 years ago

cljs-http.client/request is a batteries included version of cljs-http.core/request which does all kinds of smart things. If you want to control the things that the http client does you can create your own version of the request fn like so for example:

(def request (-> cljs-http.core/request custom-wrap-json-fn))

rpompen commented 2 years ago

O cool. Thank you very much. I should’ve studied that wrapper design up front.