Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ajax send request with encoding gzip is not working

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.

Thanks in advance

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);
}
like image 498
MANISHDAN LANGA Avatar asked Mar 25 '26 07:03

MANISHDAN LANGA


1 Answers

Considering the security, browser does not allow you to override some headers including "Content-Encoding".

like image 159
tuoxie007 Avatar answered Mar 27 '26 20:03

tuoxie007



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!