When developing a RESTful API with ASP.NET web API, I can create multiple routes to retrieve the same data. But should I? Is this considered useful or confusing?
For example, if I have an object relationship Parent> Child> Item, I can potentially have three routes returning the same separate element:
Is it helpful to provide all three routes, or to limit myself to the simplest way to avoid confusion? Is there a best practice in this regard?
, URI/ - , . , ? , URI, , , , parentId.
URI api/children , , , api/parents/:parentId/children, : parentId . , api/children, , ' .
api/children
api/parents/:parentId/children
, , . URI .
(: ),
//:
/.
:
api/parents api/parents/:parentid api/parents/:parentid/children api/children api/children/:childid api/children/:childid/items api/items api/items/:itemid
Source: https://habr.com/ru/post/1608695/More articles:PowerMockito: java.lang.NoClassDefFoundError - javahttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1608691/ways-to-return-an-object-in-c-method&usg=ALkJrhhTqP5LiEm9WB5-1c6xE8RM65-pqAHow to change the name of a route in Ruby on Rails - urlC ++: The most efficient and concise way to access a large member variable in a large dataset is c ++Do something visible on the right side after user input - javascriptSearchkick Π½Π΅ ΠΈΡΠ΅Ρ Π½Π΅ΡΠΊΠΎΠ»ΡΠΊΠΎ ΡΠ΅ΡΠΌΠΈΠ½ΠΎΠ² ΠΏΡΠΈ ΡΠΊΠ°Π·Π°Π½ΠΈΠΈ ΠΏΠΎΠ»Π΅ΠΉ - ruby-on-rails-4about mongoose connectivity - string field - node.jsMulti_field indexing indexing with array field - elasticsearchUITableView: ΠΏΡΠΎΠΊΡΡΡΠΊΠ° ΠΊ Π½ΠΈΠΆΠ½Π΅ΠΉ ΡΠ°ΡΡΠΈ Ρ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»ΡΡΠΊΠΈΠΌΠΈ/ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΡΠΌΠΈ Π²ΡΡΠΎΡΠ°ΠΌΠΈ ΡΡΠ΅Π΅ΠΊ Π½Π΅ΡΠΎΡΠ½Π° ΠΏΡΠΈ ΠΏΠ΅ΡΠ²ΠΎΠ½Π°ΡΠ°Π»ΡΠ½ΠΎΠΌ ΠΏΡΠΎΠΊΡΡΡΠΊΠ΅ - iosIOS 9 primary data transfer - multithreadingAll Articles