$.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?
- POST http://www.site.com/XXX.asmx/GetThis HTTP/1.1
- x-requested-with: XMLHttpRequest
- Accept-Language: fr-CA,en-CA;q=0.5
- Referer: www.site.com/super long data **********************
- Content-Type: application/json; charset=utf-8
- Accept-Encoding: gzip, deflate
- 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)
- Host: www.site.com
- Content-Length: 2
- Connection: Keep-Alive
- Pragma: no-cache
- Cookie: super long Cookie data