Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addLinkHeader #674

Open
gregw opened this issue Jul 5, 2024 · 1 comment
Open

addLinkHeader #674

gregw opened this issue Jul 5, 2024 · 1 comment
Labels
Enhancement New feature or request

Comments

@gregw
Copy link
Contributor

gregw commented Jul 5, 2024

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 gregw added the Enhancement New feature or request label Jul 5, 2024
@gregw
Copy link
Contributor Author

gregw commented Jul 5, 2024

The use of varargs for attribute value pairs is not the best, but less verbose than Map.of(...)

@gregw gregw added 6.2 and removed 6.2 labels Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant