简体   繁体   English

RESTFUL服务的定义和限制

[英]Definition and Restriction of RESTFUL service

I currently have an c#.net app that is communicating with another c#.net app. 我目前有一个正在与另一个c#.net应用程序通信的c#.net应用程序。 One is installed on client and the other is installed on the server. 一个安装在客户端上,另一个安装在服务器上。 They are both binded in socket using tcp connection. 它们都使用tcp连接绑定在套接字中。 When the client requests a resource, the server returns the requested resource in JSON format. 当客户端请求资源时,服务器以JSON格式返回请求的资源。 I keep hearing in other forums that REST requires HTTP. 我一直在其他论坛上听到REST需要HTTP。 However, I am not using HTTP here.. Does this mean that I am not using REST as well? 但是,我这里没有使用HTTP。这是否意味着我也没有使用REST? even though my application is stateless? 即使我的应用程序是无状态的? If not, What do you formally call this communication? 如果没有,您如何称呼这种交流?

REST is protocol-independent, per the Fielding Dissertation that defined it. 根据定义它的Fielding Dissertation ,REST是与协议无关的。 You can have systems which employ the REST architectural style over non-HTTP protocols. 可以拥有在非HTTP协议上采用REST架构样式的系统。

The Representational State Transfer (REST) style is an abstraction of the architectural elements within a distributed hypermedia system. 代表性状态转移(REST)样式是分布式超媒体系统中体系结构元素的抽象。 REST ignores the details of component implementation and protocol syntax in order to focus on the roles of components, the constraints upon their interaction with other components, and their interpretation of significant data elements. REST忽略了组件实现和协议语法的细节,以便将精力集中在组件的角色,与其他组件的交互上的约束以及对重要数据元素的解释上。 It encompasses the fundamental constraints upon components, connectors, and data that define the basis of the Web architecture, and thus the essence of its behavior as a network-based application. 它涵盖了对组件,连接器和数据的基本约束,这些约束定义了Web体系结构的基础,因此也体现了其作为基于网络的应用程序的行为的本质。

Please note that statelessness does not mean it is REST. 请注意,无状态并不意味着它就是REST。 You still need a hypermedia-driven system written around resources. 您仍然需要围绕资源编写的超媒体驱动系统。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM