How to send JSON data in XDR using the POST method

Mathankumar picture Mathankumar · May 4, 2012 · Viewed 9.2k times · Source

I want to send JSON data in XDR using the POST method. I'm able to send JSON data, however the problem is . (DOT) symbols are converted into _ (underscores). Here is the code:

if ($.browser.msie && window.XDomainRequest) {
    var xdr = new XDomainRequest(); 
    xdr.open("POST",Path);
    xdr.send(JSON.stringify(data) + '&ie=1');
    xdr.onerror = function() {
        alert('in error');
    };
    xdr.onload = function() {
        alert(xdr.responseText);
    }
} else {
    jQuery.ajax({
        type: "POST",
        url: Path,
        data: JSON.stringify(data),
        dataType: 'json',
        contentType: 'application/json',
        success: function(msg) {
                alert(msg);
        }
    });
}

Answer

Krishna Kittu picture Krishna Kittu · Sep 2, 2013

May be your server side scripting is wrong.. this code seems to be correct....