I am using following ajax utility function to make requests
function ajaxHandler(url, data)
{
return new Promise(function (resolve, reject) {
$.ajax({
type: 'POST',
url: url,
dataType: 'json',
data: data,
success: function (data) {
resolve(data);
},
error: function (xhr, textStatus, error) {
reject(error);
},
});
})
}
The default settings works great most of the time, but there are quite a few cases where I would like pass additional parameters like processData
and contentType
. How can pass processData
and contentType
for such cases ?