mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-30 03:00:06 -04:00
Merge pull request #1152 from braddunbar/implicit-tojson
toJSON is called implicitly.
This commit is contained in:
@@ -1329,7 +1329,7 @@
|
||||
// Ensure that we have the appropriate request data.
|
||||
if (!options.data && model && (method == 'create' || method == 'update')) {
|
||||
params.contentType = 'application/json';
|
||||
params.data = JSON.stringify(model.toJSON());
|
||||
params.data = JSON.stringify(model);
|
||||
}
|
||||
|
||||
// For older servers, emulate JSON by encoding the request into an HTML-form.
|
||||
|
||||
Reference in New Issue
Block a user