Strictly speaking, none. URIs are just opaque identifiers.
On Feb 17, 2016, at 1:15 PM, Paul Mansour <pa...@carlislegroup.com> wrote:
On Tuesday, February 16, 2016 at 11:11:32 AM UTC-5, Ruben Verborgh wrote:
Strictly speaking, none. URIs are just opaque identifiers.
I notice that the opaqueness of URIs appears to be a popular idea. Is this a new turn of events? Roy Fielding has, I think, emphatically stated in the past that URIs are not opaque, and that well designed URIs are a good thing, will make an API more useful, and can provide more entry points. In addition, Tim Berners-Lee has noted that the query string portion of the URI is certainly not opaque and that furthermore, the path portion, separated by slashes, was no accident of design. The hierarchy is important. And URIs must be carefully parsed in order to determine its component parts, which by definition appears to imply they are not opaque.I also note that Leonard Richardson also make the case for non-opaque UR!s in his book RESTFul Web Services.Has there been a general change of thought in the REST community on this? While REST and HATEOAS imply that resources should be discoverable, does it follow they should be obscure? I have even seen articles arguing for purposefully obscure URIs.Or am I misinterpreting what is meant by opaque? I assume it to be similar to the property of an ETag.
What reasons are there to prefer pretty urls (e.g.) /users/1/messages vs query strings (e.g.) messages?users=1I am working with someone who believes all resources should be at the 1st level and all other data is placed in the query string (aka no pretty urls). He believes that pretty urls are harder to implement and provide no benefit.
--
In fact, RESTful applications are, at all times,
encouraged to use human-meaningful, hierarchical identifiers in order
to maximize the serendipitous use of the information beyond what is
anticipated by the original application.
However, once that list is provided,
people can and do anticipate the names of other/future resources in
that name space, just as I would often directly type URIs into the
location bar rather than go through some poorly designed interactive
multi-page interface for stock charts.
If a client knows the structure of the service's URIs, it can create its own entry points into the service. This makes it easy for clients to use your service in ways you didn't think of.
Query strings are clearly not opaque to the client.
The URI Syntax, now famous through its HTTP form uses slashes to indicate a hierarchical structured name or address. Apart from that, the strings between the slashes are opaque.
Both of these statements seem to me to weaken the idea of an opaqueness "axiom".Paul
--
If the top priority is making things easier for API consumers then the best option is to provide URI templates embedded in responses. That way an API consumer never has to ever think about what a URL looks like, not how to construct it.
Darrel
--