-
Notifications
You must be signed in to change notification settings - Fork 1
wombleton/link-headers
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
@author Rowan Crawford (wombleton@gmail.com) @version 0.2 @requires jQuery, $.uritemplate @link http://github.com/wombleton/link-headers JavaScript parsing of linkheaders as per http://tools.ietf.org/html/draft-nottingham-http-link-header-10 Usage: var linkHeader = '</collection/{itemId}>; rel="foo foz bar"; type="application/json", </fozzes/{fozId}>; rel="foz baz"; type="application/json"'; var links = $.linkheaders(linkHeader); links.find('foo bar').href().expand({ itemId: 'xxx' }) => /collection/xxx links.find(['foz']).href().expand({ itemId: 'xxx' }) => /collection/xxx links.find('baz').rel() => 'foz baz' links.find('foz').attr('type') => 'application/json links.findAll('foz') => Array with two links links.each(fn) => calls fn(i, link) on each link. links.each('foo', fn) => calls fn(i, link) on each link that has rel 'foo'. MIT License
About
JavaScript parsing of link headers as described by RFC 5988
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published