我们有其余的端点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