3 ms·
"There's no standard way of getting across what a link is to another resource, or where that information should go." That doesn't quite mesh with my understand
by jalfresi 14y ago
"There's no standard way of getting across what a link is to another resource, or where that information should go."
That doesn't quite mesh with my understanding. Some media types support hyperlinks, like HTML, which describe how links should be included (anchors, forms and link elements).
For media types that don't support hyperlinks, such as images, video etc; you can use the HTTP header Link (http://www.w3.org/wiki/LinkHeader http://www.w3.org/wiki/LinkHeader).
Both these methods support the relationship attribute allowing you to specify the relationship between resources thus documenting the way clients should interact with such linked hypermedia (e.g. the HTML media type specifies that Link elements with the rel attribute should perform a HTTP GET request to the indicated resource).
In the example you gave, you could use a rel attribute like "comment" and link to the comments. RESTful clients could then follow the hyperlinks to the comments, knowing how to interact with them and what to do:
<link rel="comment" href="/comments/2398293"/>
- fusiongyro 14y agoRight, but unless your resources adhere to some other standard, there's no reason why the downstream consumer would expect to find URLs in certain places or know what to do with them if they were there. Again, I don't see this as a problem, though the OP does.