请教一个 REST api 设计的问题
1. 用来展示「我」发起的「预约」;
2. 用来展示和我相关的已经完成了的预约,「和我相关」指的是「我发起的」或者「由我审批」的
目前,1 我用的是 ‘GET /application/my’, 2 我用的是’GET /application/myRelated’,感觉设计的不好。
望各位老哥不吝赐教。
目前,1 我用的是 ‘GET /application/my’, 2 我用的是’GET /application/myRelated’,感觉设计的不好。
望各位老哥不吝赐教。
不论是我的还是谁的,都是在按照条件做筛选。
Roy T Fielding: A REST API must not define fixed resource names or hierarchies (an obvious coupling of client and server). Servers must have the freedom to control their own namespace. Instead, allow servers to instruct clients on how to construct appropriate URIs, such as is done in HTML forms and URI templates, by defining those instructions within media types and link relations. [Failure here implies that clients are assuming a resource structure due to out-of band information, such as a domain-specific standard, which is the data-oriented equivalent to RPC’s functional coupling].