This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
Is there a way to accept EDN from CLJS when making a request to the backend? I have some values that are keywords, but since these get lost on request, it sounds like I shouldn't do this if I except the frontend will consume it
I'll try to find where this is set on my server
Also I'm using cljs-http to make the requests
I have never used that library, so my help with that is limited. but I'd assume it supports EDN just fine if your server actually sends it
cljs-http certainly sends EDN fine, have not confirmed if there's an option somewhere to opt-in to receiving it
the request will have a content-type header and you should be able to look at the response itself
Oh yes, that is JSON. I figured if a CLJS library only accepted JSON then that's all I would get back if the server could do both
So I gotta read ring documentation and figure out what option I need to pass to send back EDN
Seems the server uses muuntaja and that expects the requester to provide a special header telling it what format to respond in. Trying to figure out where to put that
thats usually "negotiated" by the client sending an Accept
header, don't know if cljs-http does that on its own though
No, but I just figured that out. Added the header and it changed the response. Thank you!
Is there a reason people prefer transit+json over edn?
From what I understand, Transit is more performant. Good background discussion: https://open.spotify.com/episode/2DDbXnVVxkr96ADPvNH7fQ Separately: https://groups.google.com/g/clojure/c/9ESqyT6G5nU/m/2Ne9X6JBUh8J "edn is the best choice for human-readable data." "fressian is the highest performance option" "transit is a pragmatic midpoint between these two"