參考

RFC 一致性

HTTP/1.1

HTTP/2.0

REST by Roy Fielding

Architectural Styles and the Design of Network-based Software Architectures

HATEOAS

Cizixs Write Here—跟着 Github 学习 Restful HTTP API 设计

REST設計

REST的設計架構,簡單來說可大致上分為:

一、REST Constraints:包含Client-Server、Stateless、Cacheable等等。 二、REST Architectural Elements : REST Data Elements:包含Resource、Resource identifier等等。 REST Connectors:包含Client、Server等等。 REST Components:包含User Agent、Origin Server等等。

RESTful Web Service的設計概念,大致上可分為三種:

一、名詞(Nouns):為 Resources (資源) 定義唯一的識別,在 HTTP 中我們借用 URI 為資源進行識別定義,範例:http://car.com/cars/{carName}。 二、動詞(Verbs):在 HTTP 中使用 GET, POST, PUT, DELETE 來操作資源。 三、格式(Content types):就是REST 所謂的 Representation,也是 Header 所送出的 Content-type,其使用 MIME Types 進行定義。

RESTful 的組成

  • nouns

  • verbs

  • content types

Last updated