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 am working with a couchdb backend and syncer.js gives me headaches when saving models. Couch really likes to be data sent as JSON, but the syncer insists on classic www-form-urlencoded.
In syncer.js the emulateJSON setting for the request is hardcoded to true. commenting these 2 lines makes everything work correctly.
You're gonna want to take a close look at syncer.js' getUrl and decide whether that's a thing you even need done (since you're already doing nothing here with the results of addApiParams). If you don't, it should (hopefully - I don't know your whole situation of course) be simple to skip clientSync entirely and substitute plain Backbone.sync on the client side.
I get the impression that clientSync is mostly there for the particular internal needs of Airbnb - we were in a similar situation to yours and when I realized this it really brightened my day!
emulateJSON is just used between a client and Rendr server, but not between Rendr server and a backend (at least, latest version of dataAdapter in rendr-app-template, see code.).
If your CouchDB gets urlencoded request rather than JSON, can you check your own dataAdapter?
P.S.
When a Model acts on the server-side, syncer (serverSync) uses dataAdapter directly:
I am working with a couchdb backend and syncer.js gives me headaches when saving models. Couch really likes to be data sent as JSON, but the syncer insists on classic
www-form-urlencoded
.In syncer.js the
emulateJSON
setting for the request is hardcoded totrue
. commenting these 2 lines makes everything work correctly.Is there any way to officially change this behaviour other than patching rendr itself?
The text was updated successfully, but these errors were encountered: