mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-08 03:00:26 -04:00
Only set request content type for create/update
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user