How to structure a set of RESTful URLs
- by meetamit
Kind of a REST lightweight here... Wondering which url scheme is more appropriate for a stock market data app (BTW, all queries will be GETs as the client doesn't modify data):
Scheme 1 examples:
/stocks/ABC/news
/indexes/XYZ/news
/stocks/ABC/time_series/daily
/stocks/ABC/time_series/weekly
/groups/ABC/time_series/daily
/groups/ABC/time_series/weekly
Scheme 2 examples:
/news/stock/ABC
/news/index/XYZ
/time_series/stock/ABC/daily
/time_series/stock/ABC/weekly
/time_series/index/XYZ/daily
/time_series/index/XYZ/weekly
Scheme 3 examples:
/news/stock/ABC
/news/index/XYZ
/time_series/daily/stock/ABC
/time_series/weekly/stock/ABC
/time_series/daily/index/XYZ
/time_series/weekly/index/XYZ
Scheme 4: Something else???
The point is that for any data being requested, the url needs to encapsulate whether an item is a Stock or an Index. And, with all the RESTful talk about resources I'm confused about whether my primary resource is the stock & index or the time_series & news. Sorry if this is a silly question :/
Thanks!