silkapp/rest — pull request #90 by thsutton (2014-11-18 05:15:20+00:00)
Title: Add PathHeader to access require path in Handlers

Add a PathHeader constructor to the Header data type, allowing Handlers to require the HTTP request path be provided in their environment.

My use case is this: my team are working on a generics-based tool to publish a bunch of record types as an API and I'm building, as part of that, a facility to "watch" resources and get POST callbacks when they are modified. I'm using the URI to identify resources which, but this means that the Handlers need to be able to get the URI for the current resource.

As far as I can tell, there currently is no way to do this so I've added support for a magical and special "request path" header.