当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - XHR POST using transfer encoding chucked

问题描述:

I am trying to send from client to server data using XHR. The data can keep coming in intervals and I do not want to make individual post requests for them as it has issues of too much overhead AND out of order data. Can I somehow do chunked POST using XHR ? Chrome is disallowing me from setting chunked encoding as a header in XHR.

网友答案:

After doing a little Googling, this Google Groups post refers to the same issue:

https://groups.google.com/forum/#!topic/nodejs/2y2in955uDs

Looks like not every browser will execute the onreadystatechange event handler multiple times, which is what happens when you get a chunked response from the server. Looks like the readyState should go to 3 when it receives a chunk and execute onreadystatechange, but that might not be happening.

It could also be that each of your chunks aren't quite adhering to the spec. The Google Groups post has more info in the comments.

分享给朋友:
您可能感兴趣的文章:
随机阅读: