Ajax send request with encoding gzip (iis7) is not working below are the code for send request can some one help me what is wrong in my code.
预 收
function sendRequest(url, callback, postData)
{
var req = createXMLHTTPObject();
if (!req) {
return;
}
var method = (postData) ? "POST" : "GET";
req.open(method, "xml/" + url, true);
req.setRequestHeader( User-Agent , XMLHTTP/1.0 );
if (postData) {
req.setRequestHeader( Content-type , application/x-www-form-urlencoded );
req.setRequestHeader("Content-Encoding", "gzip");
}
req.onreadystatechange = function() {
}
req.send(postData);
}