rest - Correct RESTful call for this resource -
i'm designing restful interface existing infrastructure , i'm struggling 1 particular aspect.
we have collection of users can accessed @ /users
, elements of collection can accessed @ /users/1
etc
however each user has list of friends needs able accessed well. users/1/friends
restful call make here? doesn't qualify collection of it's own since it's relates 1 user.
any appreciated
as far restful design concerned, uri can whatever want. however, ensure interface can accessed in restfully need this:
<user> <name>bob smith</name> <link rel="friends" href="/peeps/1/amigos" /> </user>
by adding layer of indirection, client can discover link list of friends , no longer matters client uri is. can change whenever like.
uris implementation detail of server , clients should never couple on them. coupling should on rels , media types.
Comments
Post a Comment