Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3655

Hierarchy in Restful Url

$
0
0

Suppose there are resource like

  1. user - users registered

  2. book - books available in the library

  3. favourite books - users favourite books.

What is the RESTful way to construct the URL for favourite books of a user?

I have confusion on hierarchy of resources in URL. How can I form correct URLs?

The following are the URLs that comes into my mind when there is request to find out favourite books of a user.

  1. users/:user_id/favourites/books

  2. users/:user_id/books/favourites

  3. users/:user_id/favourite_books

What is the correct way of constructing the URLs?


Viewing all articles
Browse latest Browse all 3655

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>