RESTful 笔记

REST(Representational State Transfer)是 Roy Fielding 提出的一个描述互联系统架构风格的名词。

 

Another way to say REST is in HTTP, any request a client can make involves a URL and an HTTP method. With REST, the URL is designed to represent a noun and the HTTP method always maps to one of several standard verbs, which will be performed against that noun.

 

 

In summary, each HTTP method will cause a well-defined action on the resource represented by the URL it operates on. The methods can be compared to SQL commands: GET is like "SELECT," DELETE is like "DELETE," POST is like "INSERT" with an auto-generated ID, and PUT is like "INSERT OR UPDATE IF EXISTS" with an ID specified.

 

REST 指的是一组架构约束条件和原则。满足这些约束条件和原则的应用程序或设计就是 RESTful。

1. stateless

有利于scalabilty,cluster

客户端可用cache提高性能

 

2. 分层

这表示组件无法了解它与之交互的中间层以外的组件,这是博士论文中提到的,不是很理解

 

3. Get/Put/Delete方法的幂等性

 

 

4. Security

与SOAP架构相比,REST架构的优点是:

SOAP接口隐藏在SOAP Envelope中了,对外暴露的是相同的URL(对于同一个web service), 不利于代理服务器根据HTTP method做安全控制, 除非解析SOAP Envelope 内容。

 

 而且SOAP 采用HTTP Post也不利于浏览器做cache

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值