更新时间:2023-09-09 19:00:52
其中资源表示为链接
where resources are represented as links
这不是事实.链接可能是操作调用,因此它们表示可能的资源状态转换.
This is not true. Links are possibly operations calls, so they are representing possible resource state transitions.
要向集合中添加内容,您需要一个集合资源,并且必须确定要在该集合中存储的内容.在您的情况下,这可能是两件事:团体学生会员身份或学生.如果这是1:n关系,则可以存储学生并删除学生.如果这是n:m关系,则您必须存储成员身份并删除成员身份,因为您不想从存储中删除学生,只需成员身份即可.
To add something to a collection, you need a collection resource and you have to decide what you want to store in that collection. In your case this can be 2 things: group-student memberships or students. If this is an 1:n relation, then you can store students and remove students. If this is an n:m relation then you have to store memberships and remove memberships, since you don't want to remove the students from your storage, just the memberships.
您可以通过两种方式识别成员身份:
You can identify the memberships 2 ways:
/groups/1/memberships/student:1
或/students/1/memberships/group:1
/memberships/1234
/groups/1/memberships/student:1
or /students/1/memberships/group:1
/memberships/1234
注释: