I am passing xml on my ajax request. i have this:
var xml = $.json2xml(invoiceGroup, options);
It’s a json to xml conversion and this code for the ajax side
$.ajax({
url: devUrl + servEntity + 'createinvoice/',
data: xml,
type: "PUT",
dataType: 'xml',
contentType: "application/json; charset=utf-8",
ProcessData:false,
success: function (msg) {//On Successfull service call
invoiceSuccess(msg);
},
error: function(error){
console.log(error);
}
});
What am i doing wrong? when proceed firebug displays “xml is not defined” any ideas?
The
dataTypeoption is actually the data type of the response, not the request. You’ll need to alter that value to whatever type of data your server is responding with. It looks like it’s possiblyhtmlortext, but I can’t tell from what info you’ve provided.