Monday, 3 April 2017

How should I create a URL such /api/resource/identifier/resource/identifier

I have a page with categories and page with goods for each category. How should I divide my api endpoints?

is that correct to use something like this:

'/api/categories'

'/api/categories/:categoryId'

'/api/categories/:categoryId/goods'

'/api/categories/:categoryId/goods/:itemId'

or should I use structure like:

'/api/categories'

'/api/categories/:categoryId'

'/api/goods'

'/api/goods/:itemId'



via Pavel Kazakov

No comments:

Post a Comment