rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / code / Atom feed
* Constructing and parsing 'Link' header
@ 2011-09-21 11:14 dave
  0 siblings, 0 replies; only message in thread
From: dave @ 2011-09-21 11:14 UTC (permalink / raw)
  To: Rack Development


I've just been reading Steve's blog post here:
about good RESTful api's. He mentions that it's a good idea to use the
'Link' header to specify links to associated resources so that clients
don't have to construct their url's.

Is there a standard way to construct and parse these heading in Rack?
I was thinking something like this for Rails apps:

request.links = [{:link => public_gists_url, :rel => "public_gists"},
{:link => repos_url, :rel => "repos"}, {:link => gists_url, :rel =>
"gists"} ]

which would product the following header: Link: </gists/public>;
rel="public_gists", </user/repos>; rel="repos", <gists>; rel="gists"

Would this be a welcome edition to rack/contrib?

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-09-21 11:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-21 11:14 Constructing and parsing 'Link' header dave

Code repositories for project(s) associated with this inbox:


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).