<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Hypertext-driven URLs</title>
	<atom:link href="http://blog.ianbicking.org/2008/10/24/hypertext-driven-urls/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ianbicking.org/2008/10/24/hypertext-driven-urls/</link>
	<description></description>
	<lastBuildDate>Wed, 08 Sep 2010 10:58:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Mark Nottingham</title>
		<link>http://blog.ianbicking.org/2008/10/24/hypertext-driven-urls/comment-page-1/#comment-72361</link>
		<dc:creator>Mark Nottingham</dc:creator>
		<pubDate>Sun, 18 Jan 2009 09:34:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ianbicking.org/2008/10/24/hypertext-driven-urls/#comment-72361</guid>
		<description>Hear, hear. URI design is a nice-to-have, not the critical factor here. People should not sweat over these things.

WRT caching and query parameters -- it affects it only in a minor way; it disallows a cache from using heuristics to determine freshness; i.e., it has to be explicit, such as with Cache-Control: max-age. Since I hate heuristics, I&#039;d say this isn&#039;t a bad thing.

The only reason you should concern yourself with URI design really is to look for concrete benefits like being able to use relative URIs easily. Making them human-readable and intuitive are again just nice-to-haves.</description>
		<content:encoded><![CDATA[<p>Hear, hear. URI design is a nice-to-have, not the critical factor here. People should not sweat over these things.</p>

<p>WRT caching and query parameters &#8212; it affects it only in a minor way; it disallows a cache from using heuristics to determine freshness; i.e., it has to be explicit, such as with Cache-Control: max-age. Since I hate heuristics, I&#8217;d say this isn&#8217;t a bad thing.</p>

<p>The only reason you should concern yourself with URI design really is to look for concrete benefits like being able to use relative URIs easily. Making them human-readable and intuitive are again just nice-to-haves.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kumar McMillan</title>
		<link>http://blog.ianbicking.org/2008/10/24/hypertext-driven-urls/comment-page-1/#comment-54970</link>
		<dc:creator>Kumar McMillan</dc:creator>
		<pubDate>Mon, 27 Oct 2008 19:35:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ianbicking.org/2008/10/24/hypertext-driven-urls/#comment-54970</guid>
		<description>I always thought `/articles.json` and `/articles/1.json` made the most sense.  That way you could also implement `/articles.html` if you wanted.  Some people prefer `/articles?format=json`, the former is just a little less text :)</description>
		<content:encoded><![CDATA[<p>I always thought <code>/articles.json</code> and <code>/articles/1.json</code> made the most sense.  That way you could also implement <code>/articles.html</code> if you wanted.  Some people prefer <code>/articles?format=json</code>, the former is just a little less text :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Bennett</title>
		<link>http://blog.ianbicking.org/2008/10/24/hypertext-driven-urls/comment-page-1/#comment-54902</link>
		<dc:creator>James Bennett</dc:creator>
		<pubDate>Sun, 26 Oct 2008 00:20:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ianbicking.org/2008/10/24/hypertext-driven-urls/#comment-54902</guid>
		<description>I guess I wonder why the list of article URLs should be JSON; a single representation of that resource -- in HTML -- can serve machines and humans just as well if it&#039;s properly written (especially if the consumer knows the semantics of the various &quot;rel&quot; values in the HTML spec, which make for extremely easy automated navigation).</description>
		<content:encoded><![CDATA[<p>I guess I wonder why the list of article URLs should be JSON; a single representation of that resource &#8212; in HTML &#8212; can serve machines and humans just as well if it&#8217;s properly written (especially if the consumer knows the semantics of the various &#8220;rel&#8221; values in the HTML spec, which make for extremely easy automated navigation).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paolo Losi</title>
		<link>http://blog.ianbicking.org/2008/10/24/hypertext-driven-urls/comment-page-1/#comment-54890</link>
		<dc:creator>Paolo Losi</dc:creator>
		<pubDate>Sat, 25 Oct 2008 17:52:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ianbicking.org/2008/10/24/hypertext-driven-urls/#comment-54890</guid>
		<description>Yep Ian, I totally agree on XML and other media-types.
So then, at the state of the art, an API that doesn&#039;t use HTML as it&#039;s media-type
cannot be considered a &quot;pure&quot; RestFull API.
... and for a good reason ...
That&#039;s &quot;disturbing&quot; ;-)</description>
		<content:encoded><![CDATA[<p>Yep Ian, I totally agree on XML and other media-types.
So then, at the state of the art, an API that doesn&#8217;t use HTML as it&#8217;s media-type
cannot be considered a &#8220;pure&#8221; RestFull API.
&#8230; and for a good reason &#8230;
That&#8217;s &#8220;disturbing&#8221; ;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian Bicking</title>
		<link>http://blog.ianbicking.org/2008/10/24/hypertext-driven-urls/comment-page-1/#comment-54888</link>
		<dc:creator>Ian Bicking</dc:creator>
		<pubDate>Sat, 25 Oct 2008 17:42:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ianbicking.org/2008/10/24/hypertext-driven-urls/#comment-54888</guid>
		<description>That&#039;s true about the unlabeled nature of JSON, and it&#039;s certainly an appealing feature of HTML that you can understand it pretty well.  That&#039;s one of the big selling points of microformats.  XML, though, is largely as undefined as HTML (`xml:base` is handy though).  Atom is more defined, but its extensions aren&#039;t, so even if you understand the link structure of Atom you can&#039;t be sure about any extensions (the exception being `&lt;link&gt;` elements with a new kind of `rel` attribute).</description>
		<content:encoded><![CDATA[<p>That&#8217;s true about the unlabeled nature of JSON, and it&#8217;s certainly an appealing feature of HTML that you can understand it pretty well.  That&#8217;s one of the big selling points of microformats.  XML, though, is largely as undefined as HTML (<code>xml:base</code> is handy though).  Atom is more defined, but its extensions aren&#8217;t, so even if you understand the link structure of Atom you can&#8217;t be sure about any extensions (the exception being <code>&lt;link&gt;</code> elements with a new kind of <code>rel</code> attribute).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paolo Losi</title>
		<link>http://blog.ianbicking.org/2008/10/24/hypertext-driven-urls/comment-page-1/#comment-54887</link>
		<dc:creator>Paolo Losi</dc:creator>
		<pubDate>Sat, 25 Oct 2008 17:36:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ianbicking.org/2008/10/24/hypertext-driven-urls/#comment-54887</guid>
		<description>The most &quot;disturbing&quot; outcome of Fielding&#039;s very enlightening post is that JSON,
as a media type, is totally unadapted to convey explicit information on possible 
application status transfer. 

You could use, as you suggest, a json list of urls for a collection or, even more 
explicity, do something like:

{&quot;urls&quot;: [&#039;./1&#039;, &#039;./2&#039;, ...]}

but this is NOT a standard.

Confront this with HTML, a standard that explicitly specifies the A tag with HREF
attributes. A browser+human user can easily and completely infer API usage information
as well as any HTML-aware automata (i.e. http://twill.idyll.org/) can be
easily programmed for interaction without &quot;customization&quot; (I don&#039;t have to explain
that the links are to be found in the &quot;urls&quot; key).

HTML allows conveying all the API semantics without the need of out of band documentation
(i.e. the documentation of the specific Rest API)

JSON then could only be useful for &quot;leaf&quot; information...</description>
		<content:encoded><![CDATA[<p>The most &#8220;disturbing&#8221; outcome of Fielding&#8217;s very enlightening post is that JSON,
as a media type, is totally unadapted to convey explicit information on possible 
application status transfer. </p>

<p>You could use, as you suggest, a json list of urls for a collection or, even more 
explicity, do something like:</p>

<p>{&#8220;urls&#8221;: ['./1', './2', ...]}</p>

<p>but this is NOT a standard.</p>

<p>Confront this with HTML, a standard that explicitly specifies the A tag with HREF
attributes. A browser+human user can easily and completely infer API usage information
as well as any HTML-aware automata (i.e. <a href="http://twill.idyll.org/)" rel="nofollow">http://twill.idyll.org/)</a> can be
easily programmed for interaction without &#8220;customization&#8221; (I don&#8217;t have to explain
that the links are to be found in the &#8220;urls&#8221; key).</p>

<p>HTML allows conveying all the API semantics without the need of out of band documentation
(i.e. the documentation of the specific Rest API)</p>

<p>JSON then could only be useful for &#8220;leaf&#8221; information&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Donovan Preston</title>
		<link>http://blog.ianbicking.org/2008/10/24/hypertext-driven-urls/comment-page-1/#comment-54862</link>
		<dc:creator>Donovan Preston</dc:creator>
		<pubDate>Sat, 25 Oct 2008 06:58:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ianbicking.org/2008/10/24/hypertext-driven-urls/#comment-54862</guid>
		<description>Bill:

Query parameters are actually part of the URL, so each different set of query parameters is actually a new resource and has to be cached separately. If this turns out to be a problem in the real world, try stabilizing your query parameters -- sort your query parameters alphabetically for example, and refuse to serve requests without sorted query parameters. Also, make sure to move the pieces that are specifying the resource out of the query parameter into the path part and reserve the query parameters for alternate &quot;views&quot; such as sort by descending or another &quot;view transform&quot; like that.

And if you are tempted to use session ids in query parameters -- sessions are just gross and shouldn&#039;t be used. Ever. If you need to store some data that is scoped by some time interval or some other logical interval such as the duration of using a shopping cart, PUT a new resource at the beginning of the session and arrange to have DELETE called after the session times out. Then just link to it from the page where the session was created. You don&#039;t really have to literally do the PUT if you use a technique like encrypting data into the url, since all you have to do is give out the encrypted url and if it decrypts again later, you know that the resource really should exist.</description>
		<content:encoded><![CDATA[<p>Bill:</p>

<p>Query parameters are actually part of the URL, so each different set of query parameters is actually a new resource and has to be cached separately. If this turns out to be a problem in the real world, try stabilizing your query parameters &#8212; sort your query parameters alphabetically for example, and refuse to serve requests without sorted query parameters. Also, make sure to move the pieces that are specifying the resource out of the query parameter into the path part and reserve the query parameters for alternate &#8220;views&#8221; such as sort by descending or another &#8220;view transform&#8221; like that.</p>

<p>And if you are tempted to use session ids in query parameters &#8212; sessions are just gross and shouldn&#8217;t be used. Ever. If you need to store some data that is scoped by some time interval or some other logical interval such as the duration of using a shopping cart, PUT a new resource at the beginning of the session and arrange to have DELETE called after the session times out. Then just link to it from the page where the session was created. You don&#8217;t really have to literally do the PUT if you use a technique like encrypting data into the url, since all you have to do is give out the encrypted url and if it decrypts again later, you know that the resource really should exist.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Donovan Preston</title>
		<link>http://blog.ianbicking.org/2008/10/24/hypertext-driven-urls/comment-page-1/#comment-54861</link>
		<dc:creator>Donovan Preston</dc:creator>
		<pubDate>Sat, 25 Oct 2008 06:46:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ianbicking.org/2008/10/24/hypertext-driven-urls/#comment-54861</guid>
		<description>I totally agree that having json documents containing links to other json documents is a nice way to design apis. It becomes natural to think of the application as a graph that you can crawl to discover more. Links really are what made the web, not the restricted number of verbs, since browsers to this day still don&#039;t support form posts with method PUT or DELETE. Idempotency is an important concept but it&#039;s mostly an accident that most of the web is accessed by GET that mostly happens to not have side effects. As we move to a more massively concurrent read-write web instead of just a passive tv-style web we&#039;ll have to start designing with a greater understanding of idempotency.

As you mention, having documents that contain links lets you ignore the format of the url. A link is a link. It&#039;s nice to have links that are human parse-able, but it&#039;s only nice from the standpoint of the humans learning about the structure of the system. When we added some REST-style resources to Second Life, the first thing we did was bootstrap a single url into the legacy login and teleport protocols -- the &quot;seed capability&quot;. This was simply a resource which had named links to other resources that agent could use. All of the actual links were just UUIDs. Since UUIDs are unguessable it was enough to just transmit all of the resources over HTTPS and the capabilities would stay secure, while at the same time allowing extensibility from any of the resources in the graph without any other part of the system knowing.

I do think we need some more widely supported content types for common things. There are plenty of content types for various things lying around like iCal, so it&#039;s probably just a matter of important services supporting useful content types, like we are seeing lots of services usefully provide RSS and ATOM representations of certain resources. Library support in a number of languages is also important, but since many formats are based on xml (or perhaps new formats could be based on json instead?) this may not be much of an issue.

Great post.</description>
		<content:encoded><![CDATA[<p>I totally agree that having json documents containing links to other json documents is a nice way to design apis. It becomes natural to think of the application as a graph that you can crawl to discover more. Links really are what made the web, not the restricted number of verbs, since browsers to this day still don&#8217;t support form posts with method PUT or DELETE. Idempotency is an important concept but it&#8217;s mostly an accident that most of the web is accessed by GET that mostly happens to not have side effects. As we move to a more massively concurrent read-write web instead of just a passive tv-style web we&#8217;ll have to start designing with a greater understanding of idempotency.</p>

<p>As you mention, having documents that contain links lets you ignore the format of the url. A link is a link. It&#8217;s nice to have links that are human parse-able, but it&#8217;s only nice from the standpoint of the humans learning about the structure of the system. When we added some REST-style resources to Second Life, the first thing we did was bootstrap a single url into the legacy login and teleport protocols &#8212; the &#8220;seed capability&#8221;. This was simply a resource which had named links to other resources that agent could use. All of the actual links were just UUIDs. Since UUIDs are unguessable it was enough to just transmit all of the resources over HTTPS and the capabilities would stay secure, while at the same time allowing extensibility from any of the resources in the graph without any other part of the system knowing.</p>

<p>I do think we need some more widely supported content types for common things. There are plenty of content types for various things lying around like iCal, so it&#8217;s probably just a matter of important services supporting useful content types, like we are seeing lots of services usefully provide RSS and ATOM representations of certain resources. Library support in a number of languages is also important, but since many formats are based on xml (or perhaps new formats could be based on json instead?) this may not be much of an issue.</p>

<p>Great post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill de hÓra</title>
		<link>http://blog.ianbicking.org/2008/10/24/hypertext-driven-urls/comment-page-1/#comment-54852</link>
		<dc:creator>Bill de hÓra</dc:creator>
		<pubDate>Sat, 25 Oct 2008 01:07:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ianbicking.org/2008/10/24/hypertext-driven-urls/#comment-54852</guid>
		<description>&quot;So think what MIGHT make a great deal of sense from a pragmatic perspective might be application/rdf+json&quot;

Yes; most JSON structures are dictionaries so the trick is to give those dictionaries a URL and treat each key/value as RDF property/values. But I still think it could be tricky to do. For adoption purposes it&#039;s probably optimal to not say it&#039;s RDF; the &quot;no notation with denotation&quot; crowds (Atom, JSON, uF) tend to have issues imvho with RDF tax.</description>
		<content:encoded><![CDATA[<p>&#8220;So think what MIGHT make a great deal of sense from a pragmatic perspective might be application/rdf+json&#8221;</p>

<p>Yes; most JSON structures are dictionaries so the trick is to give those dictionaries a URL and treat each key/value as RDF property/values. But I still think it could be tricky to do. For adoption purposes it&#8217;s probably optimal to not say it&#8217;s RDF; the &#8220;no notation with denotation&#8221; crowds (Atom, JSON, uF) tend to have issues imvho with RDF tax.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill de hÓra</title>
		<link>http://blog.ianbicking.org/2008/10/24/hypertext-driven-urls/comment-page-1/#comment-54851</link>
		<dc:creator>Bill de hÓra</dc:creator>
		<pubDate>Sat, 25 Oct 2008 01:03:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ianbicking.org/2008/10/24/hypertext-driven-urls/#comment-54851</guid>
		<description>&quot;this is why the URL structure of applications doesn&#039;t affect their RESTfulness&quot;

not entirely true- query parameters can affect caching.

&quot;if you can’t use a crappy URL structure with that same API then probably something is wrong with that API.&quot;

Right. So in the AtomPub world we love service documents and the link construct. Clients never need to know URL structure. Except where they do and we revert to documenting parameters (like google charts) or using domain specific discovery languages (like opensearch)

But I think Dave Johnson caught flak here for no good reason and I find both of Roy&#039;s posts lacking to some extent. Something like &quot;Do a GET /articles/{id} to get the representation of a specific article.&quot; is a perfectly good way to explain an &quot;API&quot; to a developer or an implementor. Lesson - don&#039;t confuse explanation with specification. Alternatively, try to define an API for a developer or an implementor, without referring to methods, url structures or response codes. It&#039;s hard to do well.

The real problem - calling these things &quot;APIs&quot; is confusing the heck out of a lot of people.</description>
		<content:encoded><![CDATA[<p>&#8220;this is why the URL structure of applications doesn&#8217;t affect their RESTfulness&#8221;</p>

<p>not entirely true- query parameters can affect caching.</p>

<p>&#8220;if you can’t use a crappy URL structure with that same API then probably something is wrong with that API.&#8221;</p>

<p>Right. So in the AtomPub world we love service documents and the link construct. Clients never need to know URL structure. Except where they do and we revert to documenting parameters (like google charts) or using domain specific discovery languages (like opensearch)</p>

<p>But I think Dave Johnson caught flak here for no good reason and I find both of Roy&#8217;s posts lacking to some extent. Something like &#8220;Do a GET /articles/{id} to get the representation of a specific article.&#8221; is a perfectly good way to explain an &#8220;API&#8221; to a developer or an implementor. Lesson &#8211; don&#8217;t confuse explanation with specification. Alternatively, try to define an API for a developer or an implementor, without referring to methods, url structures or response codes. It&#8217;s hard to do well.</p>

<p>The real problem &#8211; calling these things &#8220;APIs&#8221; is confusing the heck out of a lot of people.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.561 seconds -->
