Reputation: 917
I have a question about designing REST APIs.
Lets say that GET /schools/1/students
returns all students from a school with the id of 1.
Should POST
, PUT
and DELETE
requests be sent to /schools/1/students
to manipulate student resources going forward or to /students
?
Upvotes: 0
Views: 39
Reputation: 989
GET all students - /schools/1/students
GET one student - /schools/1/students/:student_id
POST - create new student (/schools/1/students)
PUT - update ONE student (/schools/1/students/:student_id)
DELETE - delete ONE student (/schools/1/students/:student_id)
Upvotes: 2