var payload = '<?xml version="1.0" encoding="utf-8"?><data>XML_GOES_HERE</data>';
$.ajax({
url: "/Data/SaveXML/",
type: "POST",
processData: false,
contentType: "application/json; charset=utf-8",
data: JSON.stringify({ payload: payload })
})
contentType
Set to application/json
, the data becomes an object, which is then JSON.stringify
run through the method to ensure querystring
a variety of characters can be sent.