title: Writing a client for a RESTful (hypermedia) API
body: <p>I've been reading up on 'real' RESTful APIs for a few days now, and I <em>think</em> I'm near to groking what it's about. </p>
  
  <p>But one of the things that I stumble on is that I can't even begin to imagine how one would write a client for a 'real' hypermedia API:</p>
  
  <ol>
  <li><p>Most of the examples I've read talk about browsers and spiders, but that's not especially helpful: one is human-directed and 'intelligent', the other is dumb and 'random'. As it stands, I kind of get the impression that you'd need to learn AI to get a client working.</p></li>
  <li><p>One thing that isn't clear to me is how the client knows which verb to use on any given link? Is that implicit in the 'rel' type of the uri? The alternative (reading <a href="http://agilesight.com/blogs/pabloc/?p=19">here</a>) seems to be using xhtml and having a client which can parse and post forms.</p></li>
  <li><p>How likely is it that a link will change, but not the route to the link?
  In most examples you see around, the route and the link are the same:</p></li>
  </ol>
  
  <p>eg. if I want to set up a client which will bring me back the list of cakes from Toni's Cake Shop:</p>
  
  <pre><code>http://tonis.com
  { link: { type : "cakes" ; uri : "http://tonis.com/cakes" } }
  </code></pre>
  
  <p>What happens when Toni's becomes Toni's Food Shop, and the link becomes <code>http://tonis.com/desserts/cakes</code>?</p>
  
  <p>Do we keep the initial <code>cakes</code> link at the root, for reverse-compatibility? And if not, how do we do a 'redirect' for the poor little agent who has been told "go to root, look for cakes"?</p>
  
  <p>What am I missing?</p>