$.ajax POST and Http headers

$.ajax POST and Http headers

Hi all, i want to call a web service from jQuery AJAX method, it is working perfectlly, but i have a big request, look at the example i attached. It is 1,567 bytes length.

i only need to pass 2 bytes and i receive gzip data (around 300 bytes)

i want to reduce as much as possible HTTP overhead by removing (at least) Referer and User-Agent.

i tried with beforeSend but it is not working.

any idea on how to do the trick?

Thank you


  1. POST http://www.site.com/XXX.asmx/GetThis HTTP/1.1
  2. x-requested-with: XMLHttpRequest
  3. Accept-Language: fr-CA,en-CA;q=0.5
  4. Referer: www.site.com/super long data **********************
  5. Accept: application/json, text/javascript, */*
  6. Content-Type: application/json; charset=utf-8
  7. Accept-Encoding: gzip, deflate
  8. User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; OfficeLiveConnector.1.5; OfficeLivePatch.1.3; .NET4.0C; .NET4.0E)
  9. Host: www.site.com
  10. Content-Length: 2
  11. Connection: Keep-Alive
  12. Pragma: no-cache
  13. Cookie: super long Cookie data