Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A good ReST documentation would mean documenting your media type and only your media type.</p> <p>In a typical scenario, you'd produce a document like so:</p> <h2>The Acme Corp XML formats</h2> <h3>Link Discovery</h3> <p>Links to various resources are described in a document that can be found by issuing a GET or HEAD request to the server on a bookmark URI (typically the root of the server, <a href="http://www.acme.org" rel="nofollow noreferrer">http://www.acme.org</a>), and looking for an HTTP Link header:</p> <p><code>Link: &lt;xxx&gt;;rel="http://rel.acme.org/services";type=application/vnd.acme.services+xml </code></p> <p>where the <code>rel</code> part is the link relationship, and the <code>xxx</code> is the URI for which the relationship has been established.</p> <h2>Link Relationships</h2> <p>This document defines the following relationship names:</p> <ul> <li><a href="http://rel.acme.org/services" rel="nofollow noreferrer">http://rel.acme.org/services</a> The link relationship describes the list of links that can be navigated.</li> <li><a href="http://rel.acme.org/customers" rel="nofollow noreferrer">http://rel.acme.org/customers</a> The link for which this relationship is used is the list of customers.</li> </ul> <h2>Media Types</h2> <p>The <code>application/vnd.acme.services+xml</code> is a document with an <code>xml</code> serialization that describes a list of links an application may want to process.</p> <pre class="lang-xml prettyprint-override"><code>&lt;links&gt; &lt;link rel="http://rel.acme.org/customers" href="http://www.acme.org/services/customers" type="application/vnd.acme.customers+xml" /&gt; &lt;/link&gt; </code></pre> <p>The <code>applcation/vnd.acme.customers+xml</code> is a document with an <code>xml</code> serialization that describes customers.</p> <h3>Example documents:</h3> <pre class="lang-xml prettyprint-override"><code>&lt;customers&gt; &lt;customer firstname="Darth" lastname="Vador" href="http://www.acme.org/services/customers/28" /&gt; &lt;/customer&gt; </code></pre> <p>etc...</p> <p>The point is to give a way to the developer to follow the links you define. First find the link to the <em>index</em> so they can get the list of things they can navigate to.</p> <p>Once they discover that document, they discover that they can see a list of customers at a certain Uri, and can do a <code>GET</code> against it.</p> <p>If they find a customer of interest, they can follow the link defined in <code>/customers/customer/@href</code> and issue a <code>GET</code> to retrieve a representation of that customer.</p> <p>From there, your media type could embed actions that are available to the user, using more links. You also have the additional option of issuing an OPTIONS request on the resource to know if you can allow deleting the resource, or a PUT if you can save the document back after modification.</p> <p>So a good documentation doesn't ever:</p> <ul> <li>give static links</li> <li>give interaction such as "you can issue POST on Customer with this media type and that will mean the move operation". The client should issue a POST against Customer only because your XML document has specified it that way.</li> </ul> <p>The point of all this is to achieve minimum coupling between clients and servers. The client can be very smart in displaying and discovering resources (showing forms and god knows what else), but is totally dumb as to what the actual workflow is: the server decides.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload