Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
资源中的字段是否有首选 url 方案?
我可以创建一个线程资源并使用以下 url 来检索 thread.posts where thread.id = 8
/api/v1/thread/8/posts/
或者我可以使用帖子资源检索同一组帖子
/api/v1/post/thread_id__eq=8
post有外键thread。
post
thread
有首选的方法吗?(更好的网址方案或美味的约定?)
这可能有点固执己见,但对我来说,第一个选项将是首选。为什么?
GET