This is one of those little detail (and possibly religious) questions. Let’s assume we’re constructing a REST architecture, and for definiteness lets assume the service needs three parameters, x, y, and z. Reading the various works about REST, it would seem that this should be expressed as a URI like
http://myservice.example.com/service/ x / y / z
Having written a lot of CGIs in the past, it seems about as natural to express this
Is there any particular reason to prefer the all-slashes form?
The reason is small but here it is.
Cool URI’s Don’t Change.
The
http://myservice.example.com/resource/x/y/z/form makes a claim in front of God and everybody that this is the path to a specific resource.The
http://myservice.example.com/service?x=val,y=val,z=valform doesn’t make as strong a claim. It says there’s a piece of code namedservicethat will try to do some sort of query. No guarantees.