Merge pull request #469 from afeld/patch-1

processData should default to true
This commit is contained in:
Jeremy Ashkenas
2011-07-19 05:27:20 -07:00

View File

@@ -1035,8 +1035,7 @@
// Default JSON-request options.
var params = _.extend({
type: type,
dataType: 'json',
processData: false
dataType: 'json'
}, options);
// Ensure that we have a URL.
@@ -1053,7 +1052,6 @@
// For older servers, emulate JSON by encoding the request into an HTML-form.
if (Backbone.emulateJSON) {
params.contentType = 'application/x-www-form-urlencoded';
params.processData = true;
params.data = params.data ? {model : params.data} : {};
}
@@ -1069,6 +1067,11 @@
}
}
// Don't process data on a non-GET request.
if (params.type !== 'GET') {
params.processData = false;
}
// Make the request.
return $.ajax(params);
};