What URL scheme would be better for "nested" resources in a RESTful application?

Posted by Luke404 on Stack Overflow See other posts from Stack Overflow or by Luke404
Published on 2010-03-23T15:53:53Z Indexed on 2010/03/23 16:03 UTC
Read the original article Hit count: 506

Filed under:
|

Let's say we want a RESTful web service to manage some logically nested resources, where each instance of resource 'B' is logically contained by an instance of resource 'A'. The first example that comes to mind, working as a sysadmin, is email accounts and their domains: [email protected] [email protected] [email protected] ...

What URL scheme would you suggest? At first I'd try:

 /domain/[domainname]
 /domain/[domainname]/account/[accountname]

is that in line with RESTful principles? or should I go with something like:

 /domain/[domainname]
 /account/[account@domainname]/

or anything else?

© Stack Overflow or respective owner

Related posts about rest

Related posts about url-routing