I would like to ask a question about the design of the HTTP REST API that I am viewing.
I sometimes have to access the widget with id 3:
http://ourserver/service/widgets/3
Get widget with ID 3
But I also sometimes need to access the widget using SKU #.
Is it wrong to expose the same resource through 2 URLs?
BUt I need my clients to get a widget with either its identifier or its SKU.
Which of the following is better?
http://ourserver/service/widgets/bysku/skyunumberhttp://ourserver/service/widgets/skyunumber?idtype=sku
Again, I need my clients to be able to search the widget in two different ways. What is the best way to create urls?
rest
source share