REST(Representational State Transfer)定義:
A software architectural style that was created to guide the design and development of the architecture for the World Wide Web. REST defines a set of constraints for how the architecture of an Internet-scale distributed hypermedia system, such as the Web, should behave.
RESTful api特性:
- Uniform Interface(有唯一的URL表示資源位置,統一的 API 接口)
- Stateless(無狀態)
- Cacheable (可更高效利用「快取」來提高回應速度)
- Client-Server (客戶伺服器分離模式,任何一個客戶端與伺服器都是可替換的。)
- Layered System (分層的系統,客戶端不知道他聯絡的是不是最終伺服器。)
- Code on Demand(可選):伺服器可以將能力擴充到客戶端,如果客戶端可以執行的話。這個功能是可選擇的。
每一個特性的詳細介紹請參閱Ref下的連結
Ref :
https://zh.wikipedia.org/wiki/%E8%A1%A8%E7%8E%B0%E5%B1%82%E7%8A%B6%E6%80%81%E8%BD%AC%E6%8D%A2