11 ms·
The Link header [1] works very well for this. It exports an index of links with the same semantics as the <link> element. <link rel="stylesheet" href="/style
by pfraze 13y ago
The Link header [1] works very well for this. It exports an index of links with the same semantics as the <link> element.
<link rel="stylesheet" href="/styles.css">
But in the header, which means API consumers don't have to search the response body for links, and can specifically request the index with a HEAD request.
Link: </styles.css>; rel="stylesheet"
The reltype is pretty powerful - it enables semantic standards and lets a client make assumptions about endpoints. Since the Link header is a standard format of, you know, links, it's also very discoverable.
1. http://tools.ietf.org/html/rfc5988 http://tools.ietf.org/html/rfc5988
EDIT: hm. No idea why I got downvoted, but I tightened it up to get more to the OP's point.