rest - What is the correct way to process nested resources in a RESTful API? -
consider i'm using following restful api endpoints: /users/: show users /users/$user_id/: show specific user /users/$user_id/posts/: show posts user /users/$user_id/posts/$post_id/: show specific post user constraint in data model: post has user. by "processing nested resources" mean handling crud operations. should implement crud operations (post, put, patch, delete) on /users/$user_id/posts/ endpoint or should create endpoint /posts/ , handle crud operations there, while keeping first endpoint read-only? sorry if question exists in maybe form on so. :-) there's "fud" around restful apis. thanks in advance tips/clarifications! kind regards, k. you should implement operations on existing /posts/ , /posts/$post_id/ endpoints. there's reason make multiple endpoints represent same resources. why make them figure out can on /users/$user_id/posts/$post_id/ have go /posts/$post_id/ delete? sometimes, people implement as ...