如何与QUOT;流" JSON从服务器到客户端使用的JavaScript客户端、服务器、QUOT、JSON

2023-09-11 00:35:51 作者:〆﹏不习惯没有你的日子

我用Ajax和JSON,我可以发送一个请求,并得到一个解析一个JSON请求不够熟悉。理想情况下,我想接收多个响应定期更新进度条。这样,客户可以有一个积极的反馈。

I'm familiar enough with Ajax and JSON that I can send a request and get a parse a JSON request. Ideally I'd like to receive multiple response to periodically update a progress bar. This way clients can have a positive feedback.

我听说JSON数据流,但还没有找到如何实现一个很好的资源。有谁知道一个很好的资源,或如何做到这一点?

I've heard of JSON streams but have not found a good resource on how to implement this. Does anyone know of a good resource or how to do this?

推荐答案

JSON是数据要通过HTTP协议(如文本,HTML,PDF等),只是还没有另一种格式。你可能指的是 cometd 。

JSON is just yet another format of data going over the HTTP protocol (like text, html, pdf, etc). You are probably referring to cometd.

这允许你打开一个持久连接,并从服务器到客户端推送数据(即流式处理)。任何格式有效推动,客户端只需要了解它。

This allows you to open a persistent connection and push data from the server to the client (ie stream it). Any format is valid to push, the client just needs to understand it.

 
精彩推荐