Why code below sent data as City=Moscow&Age=25 instead of JSON format?
var arr = {City:'Moscow', Age:25};
$.ajax(
{
url: "Ajax.ashx",
type: "POST",
data: arr,
dataType: 'json',
async: false,
success: function(msg) {
alert(msg);
}
}
);
datafrom being converted to query string format setprocessData: false. See api.jquery.com/jquery.ajax/#sending-data-to-server