About RESTful api

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特性:

  1. Uniform Interface(有唯一的URL表示資源位置,統一的 API 接口)
  2. Stateless(無狀態)
  3. Cacheable (可更高效利用「快取」來提高回應速度)
  4. Client-Server (客戶伺服器分離模式,任何一個客戶端與伺服器都是可替換的。)
  5. Layered System (分層的系統,客戶端不知道他聯絡的是不是最終伺服器。)
  6. Code on Demand(可選):伺服器可以將能力擴充到客戶端,如果客戶端可以執行的話。這個功能是可選擇的。


Ref :



%d 位部落客按了讚: