Open mbertheau opened 5 years ago
That’s... somewhat bizarre and definitely not intended. I can’t remember anything that means this is hard to get right, either.
Can you see if you can fix it?
On Wed, 19 Dec 2018 at 09:58, Markus Bertheau notifications@github.com wrote:
This code honors :keywords? true:
(POST url {:headers {:X-CSRFToken csrf-token} :params data :response-format :json :keywords? true :handler on-success :error-handler on-error})
In order to support transit responses, I removed :response-format so that cljs-ajax will use the Content-Type of the response to determine the response format:
(POST url {:headers {:X-CSRFToken csrf-token} :params data :keywords? true :handler on-success :error-handler on-error})
That does work, and I can receive transit and json responses fine. However, with JSON responses :keywords? isn't honored anymore and map keys are strings instead of keywords. Is this the intended behavior?
Btw, the fix I'm running now is to explicitly specify the two response formats that I need supported:
(POST url {:headers {:X-CSRFToken csrf-token} :params data :response-format [:json :transit] :keywords? true :handler on-success :error-handler on-error})
Auto-detecting which one it is still works, and :keywords? is honored as well.
But it seems arbitrary that in the second example :keywords? should be ignored.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/JulianBirch/cljs-ajax/issues/231, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFIkyO7uje0kJI6KIhNw0IqVPsozWp2ks5u6g3UgaJpZM4ZZ5hb .
-- Sent from an iPhone, please excuse brevity and typos.
This code honors
:keywords? true
:In order to support transit responses, I removed
:response-format
so that cljs-ajax will use the Content-Type of the response to determine the response format:That does work, and I can receive transit and json responses fine. However, with JSON responses
:keywords?
isn't honored anymore and map keys are strings instead of keywords. Is this the intended behavior?Btw, the fix I'm running now is to explicitly specify the two response formats that I need supported:
Auto-detecting which one it is still works, and
:keywords?
is honored as well.But it seems arbitrary that in the second example
:keywords?
should be ignored.