How should a REST URL schema look like for a tree hierarchy?

前端 未结 5 829
Happy的楠姐
Happy的楠姐 2020-12-24 06:04

Let\'s assume that I have stores, shelves in a store, and products on a shelf. So in order to get a list of products on a shelf in a store, I\'d use the following request:

5条回答
  •  我在风中等你
    2020-12-24 07:03

    Don't design a REST api based on an URL structure. Here is how I think you should go about designing a REST api.

    Trying to define a REST interface without discussing what links will be contained in what resources is like discussing an RPC interface and ignoring parameters and return values.

提交回复
热议问题