我們有其餘的端點POST,PUT,DELETE的產品。 POST請求的身體看起來像: {
"Id": Unique identifier of the product,
"Description": Product description,
"Price": Price of the product
}
現在,由於POST被認爲是不冪等,但在這裏我們不能讓
考慮接受GET請求列表項的一個RESTful API: GET /1.0/items/
>> {"items": [{}, {}, ..., {}]} # All items returned
現在考慮每個項目都有一個色域,而且我可以過濾我的項目: GET /1.0/items?color=blue
>> {"items": [{}, {}, ..., {}]} # Only blue i