开发者

Make ajax POST without requiring a response?

Is there a way to make an $.ajax POST request:

  1. without requiring a response
  2. so the server doesn't even try to return anything

Are there some HTTP headers to accomplish this? The goal would be to track statistics with minimal server and client request process开发者_运维技巧ing.


The server should return a HTTP/204 No Content response. That's as close as you can get.


If it is no problem in terms of security, and the amount of data you send is at maximum 2K minus the length of your URL, use a GET request instead. A GET request sends only one TCP packet, instead of two packets as a POST request does (first the header, then the data).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜