RESTful:双向沟通

myb*_*dur 5 rest client-server

I was wondering if it is possible to have a RESTful web service and a bidirectional communication with the clients and server.

In my case the state on the server can change, so the server should send a message to the clients to update themself. Perhaps that's totally against the RESTful idea.

Can I AJAX help me with this issue?

Thanks!

Sha*_*men 5

在标准的 http 范式下不太可能,但请查看Comet以了解该问题的可能解决方法,并且始终存在轮询。