I am using jQuery ajax to call my WCF service using HTTP POST. The response is encrypted with gzip and this causes problems in my environment. (See this question .) If the response is not gzip encoded, everything is fine.
So, looking in Fiddler, I see that the generated jQuery query has the following headers:
Accept-Encoding: gzip,deflate,sdch
If through fiddler I changed this value to None , then the answer is not compressed, and this is what I want. All I have to do is change the value in the "Accept-Encoding" header.
It seems like this header value cannot be changed with the .ajax . (See this forum post ).
Can someone tell me what parameters I need to change this header value.
Here is my current attempt. My headers parameter seems to be ignored.
$telerik.$.ajaxSetup({ accepts: 'application/json, text/javascript, */*' }); var parameters = { "playerId": args.playerId }; var dataInJsonFormat = '{ "playerId": ' + args.playerId + '}'; var ajaxCallParameters = { accepts: 'application/json, text/javascript, */*', async: true, cache: false, contentType: "application/json; charset=utf-8", url: "../Services/CmsWebService.svc/SendUpdateRequestToPlayer", headers: { "Accept-Encoding" : "None" }, type: "POST", data: dataInJsonFormat, dataType: 'json', error: function (jqXHR, textStatus, errorThrown) { var errorString = 'Error thrown from ajax call: ' + textStatus + 'Error: ' + errorThrown; var displayPanel = document.getElementById('requestStatusUpdateResults'); $telerik.$(displayPanel).text(errorString); }, success: function (data, textStatus, jqXHR) { var displayPanel = document.getElementById('requestStatusUpdateResults'); $telerik.$(displayPanel).text(data.d); } }; $telerik.$.ajax(ajaxCallParameters);