Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You are right, and I also am glad that people come around from their earlier ignorance.

I wish to amend #1. There exists a clever hack that allows any media type to have hyperlinks. Let's take text/vcard as an example, it's a nice existing standard that can be used as representation for, say, a user. (Let's ignore for a moment that a special XML serialisation and the XFN microformat exists, so that the vcard semantics are embeddable into HTML.) It can be augmented with RFC 5988 Link headers:

    GET /user?id=123 HTTP/1.1

    ----

    HTTP/1.1 200 OK
    Content-Type: text/vcard
    Link: </user?id=123>; rel="item self"
    Link: </user?id=122>; rel="next"
    Link: </user?id=124>; rel="prev"
    Link: </user?id=1>; rel="first"
    Link: </user?id=9000>; rel="last"
    Link: </user>; rel="collection http://example.org/rel/foobar_users"

    BEGIN:VCARD
    VERSION:4.0
    …
You see, this works for any resource even when the format traditionally has no (inline) hyperlinks, e.g. image/gif. I also like to replicate inline links as a Link header because it allows an UA to traverse resources with the HEAD method alone.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: