REST 与基于会话的应用程序 [英] REST vs Session-Based-Applications

查看:50
本文介绍了REST 与基于会话的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于 REST 与其他 Web 服务的问题,但我不知道从哪里开始.我知道 REST 是什么以及使用它实现的服务应该如何工作,我也对 SOAP 和 RPC 有基本的了解,但我真的无法说出 REST 与基于会话的应用程序有什么不同的问题的含义.

我知道 REST 是无状态的,但我该如何正确回答这个问题?有什么提示或好的资源可以通读吗?

解决方案

REST 与基于会话的应用有何不同?

REST 与基于会话的应用程序不同,因为它是无状态的,而基于会话的应用程序则不是.

保持会话"无非是服务器保持用户的状态.

REST 不这样做,它使用超媒体来指导应用程序的状态.这就是 HATEOAS 首字母缩略词的来源 (Hypermedia As The Engine Ostrong>f A应用S状态).

基本上,HATEOAS 意味着您的服务应该以与常规网站引导用户相同的方式引导其客户:通过超链接(和媒体类型).Roy Fielding 在他的博客中对此进行了扩展.

I got a question regarding REST vs other web services, but I just can't figure out where to start. I know what REST ist and how services implemented with it should work, I also have a basic understanding of SOAP and RPCs, but I really can't tell what is meant with the question what differs REST from session-based-applications.

I know that REST is stateless, but how can I answer this question correctly? Any hints or good sources to read through?

解决方案

What differs REST from session-based apps?

REST is different fron session-based applications because it is stateless and session-based are not.

Keeping "Session" is nothing more than the server keeping the state of the user.

REST doesn't do that, it uses hypermedia to guide the state of the app. That's where the HATEOAS acronym comes from (Hypermedia As The Engine Of Application State).

Basically, HATEOAS means your service should guide its clients the same way a regular website guides its users: by means of hyperlinks (and media types). Roy Fielding expands on this in his blog.

这篇关于REST 与基于会话的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆