Only set request content type for create/update

This commit is contained in:
Jason Davies
2011-03-09 18:35:26 +00:00
parent 0cdc525961
commit 83250a5a62

View File

@@ -971,7 +971,6 @@
// Default JSON-request options.
var params = _.extend({
type: type,
contentType: 'application/json',
dataType: 'json',
processData: false
}, options);
@@ -983,6 +982,7 @@
// Ensure that we have the appropriate request data.
if (!params.data && model && (method == 'create' || method == 'update')) {
params.contentType = 'application/json',
params.data = JSON.stringify(model.toJSON());
}