servlet icon indicating copy to clipboard operation
servlet copied to clipboard

addLinkHeader

Open gregw opened this issue 1 year ago • 1 comments

From #672:

To assist with early hints, should we add a response method like:

     void addLinkHeader(String uri, String relationship, String... attributeValuePairs);

So this could be used like:

    response.addLinkHeader("http://example.com/TheBook/chapter2", "previous", "title", "previous chapter"
    response.addLinkHeader("/", "http://example.net/foo");
    response.addLinkHeader("/terms", "copyright", "anchor","#foo");

and would generate the following headers:

   Link: <http://example.com/TheBook/chapter2>; rel="previous"; title="previous chapter"
   Link: </>; rel="http://example.net/foo"
   Link: </terms>; rel="copyright"; anchor="#foo"

gregw avatar Jul 05 '24 10:07 gregw