JSON Requests

I’ve been using Backbone.js on the front end for several projects. The default requests for Backbone are of type application/json with the json being the body of the http request. Unless I am mistaken, neither CF or ColdBox natively handle these requests. While you can configure Backbone to make a different request type, I have tried to stick with the ‘default’ backbone approach where possible.

So, I wrote an interceptor to handle these json requests. I would love feedback on a) is this a decent approach? and b) is there a better way to handle this?

Here’s my interceptor: https://gist.github.com/1118410


You’ve resolved it the same way I have.


Ben, I just ran into this problem today while working with the Post JSON example for the fetch API from within a React/Redux application. Your JSON Interceptor really helped big time – thank you!