diff --git a/lib/collection.js b/lib/collection.js index 22f1def..1984b45 100644 --- a/lib/collection.js +++ b/lib/collection.js @@ -48,9 +48,7 @@ var params = { type: execMethodType, - dataType: 'json', - contentType: 'application/json', - processData: false + dataType: 'json' }; // Ensure that we have a URL and add method name to it @@ -60,7 +58,15 @@ } // stringify data to json - if (options.data && _.isObject(options.data)) { + if ( + options.data && + _.isObject(options.data) && + _([ + 'post', 'patch', 'put' + ]).contains((options.type || params.type).toLowerCase()) + ) { + params.processData = false; + params.contentType = 'application/json'; options.data = JSON.stringify(options.data); }