php - Hierarchy in Restful Url -
suppose there resource
user - users registered
book - books available in library
favourite books - users favourite books.
what restful way construct url favourite books of user?.
i have confusion on hierarchy of resources in url. please me form correct urls.
the following urls comes mind when there request find out favourite books of user.
users/:user_id/favourites/books
users/:user_id/books/favourites
users/:user_id/favourite_books
please me form correct way of constructing urls.
i think it's matter of personal preference.
is favourites important part of user , have more favorites movies
example? i'd go one:
1. users/:user_id/favourites/books
is 'property' of user's books , there more options, example last_read
? i'd go one:
2. users/:user_id/books/favourites
is 'property' of user , there more options, example age
? i'd go one:
3. users/:user_id/favourite_books
you might want ask question on programmers, think you'll more replies there.
Comments
Post a Comment