Is ReST over websockets possible?

前端 未结 8 964
梦如初夏
梦如初夏 2020-12-13 03:43

I am planning to develop a web based chat application which takes in ReSTful requests, translate them to XMPP and deliver them to an XMPP server.

Using websockets fo

相关标签:
8条回答
  • 2020-12-13 04:18

    I understand this post is really old, but wanted to interject a bit further on the notion that "So if I choose a REST architecture I forfeit the ability for real-time communications?".

    In a word, no. A number of REST style implementations I have had experience with leverage REST for compatibility, discoverability, and as a means to scale across different devices in the shadow of IoT.

    However, in addition to using WS in addition to REST to facilitate near real-time transmission. There are also a number of abstractions which really help with this and allow you to focus on building your API and deciding how the RT components of the consuming applications should operate.

    I would suggest taking a look at things like Tibco Smart-Sockets, or SignalR if you're looking to build a REST API and would like to avoid re-creating the wheel for your RT needs.

    0 讨论(0)
  • 2020-12-13 04:19

    Yes. You can use REST over WebSocket with library like SwaggerSocket.

    0 讨论(0)
提交回复
热议问题