Hierarchical RESTful URL design

后端 未结 3 1800
青春惊慌失措
青春惊慌失措 2020-12-04 16:00

I have perused the questions asked about this, but I still don\'t have a definitive answer.

I have an application and would like to build a RESTful API to expose a s

3条回答
  •  执笔经年
    2020-12-04 16:33

    IMHO you are modelling it well.

    Regarding 1 I'd rather go with resource/id rather than query param. But one thing you must have in mind when modelling is the cache mechanism by proxy and so on. So do not forget the headers.

    I go for query params for filtering and those sorts.

    About the login, the credentials should be in the headers, and no specific resource is needed. Just apply per resource security.

提交回复
热议问题