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

links() function insufficient for attributes other than rel #2575

Open
daxim opened this issue Mar 3, 2015 · 3 comments · May be fixed by #2738
Open

links() function insufficient for attributes other than rel #2575

daxim opened this issue Mar 3, 2015 · 3 comments · May be fixed by #2738

Comments

@daxim
Copy link

daxim commented Mar 3, 2015

With v4 links() function it is not possible to set the type attribute, inter alia.

I propose that an interface variant is added where the function takes an array of objects, e.g.:

res.links([
    {
        href: 'http://api.example.com/users?page=2',
        rel: 'next',
        title: 'next chapter',
        type: 'text/plain;charset=UTF-8'
    },
    {
        href: 'http://api.example.com/users?page=5',
        rel: 'last',
        title: 'the grand finale',
        type: 'video/webm'
    }
]);
@dougwilson
Copy link
Contributor

Sounds fine to me, we can certainly add something.

leaves4j added a commit to leaves4j/express that referenced this issue Aug 21, 2015
leaves4j added a commit to leaves4j/express that referenced this issue Aug 21, 2015
… accept an array as arguments(cancel the code format)
@leaves4j leaves4j linked a pull request Aug 21, 2015 that will close this issue
@tunniclm
Copy link
Contributor

tunniclm commented Feb 8, 2016

The following prs also attempt to address this: #2702 (which follows on from #2619).

@tunniclm
Copy link
Contributor

tunniclm commented Feb 8, 2016

#2702 incorporates some feedback from @dougwilson regarding validation of the provided keys which is not present in #2619 or #2575.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants