W3C home > Mailing lists > Public > uri@w3.org > July 2007

Re: URI Templates - embedded variables?

From: Mark Nottingham <mnot@mnot.net>
Date: Mon, 30 Jul 2007 11:56:16 -0700
Message-Id: <96B12C44-2FD3-44BC-9B13-4370C1697A3F@mnot.net>
Cc: uri@w3.org
To: Lindsay Evans <lindsaye@gmail.com>

G'day Lindsay,

I've got a somewhat similar use case, where I want to pass a template  
through to another server for processing. So, you might start with  
something like this;
   http://example.com/login?{redirect_to}

which gets expanded into something like this;
   http://example.com/login?http://other.example.net/target/%7btoken%7d

which the recipient knows to interpret as containing the template
   http://other.example.net/target/{token}

Is that along the lines of what you're thinking?

Cheers,



On 28/07/2007, at 7:32 PM, Lindsay Evans wrote:

>
> Hi all,
>
> As I've been building something that makes use of a similar concept to
> URI Templates, I thought I'd have a crack at building an
> implementation in Ruby.
>
> I've had a look through the list archives, but haven't seen this
> mentioned: what is the expected behaviour when a variable is embedded
> in another variable?
>
> e.g.
> foo = 'xyz'
> bar = 'foo={foo}'
> template = 'http://example.com/?{bar}'
>
> At the moment I'm just treating the brackets as literal characters and
> escaping them:
> 'http://example.com/?foo=%7Bfoo%7D'
>
> but I can imagine the intention in such a case to be for the variable
> to be evaluated:
> 'http://example.com/?foo=xyz'
>
> -- 
> Lindsay Evans
> http://linz.id.au/
>
>


--
Mark Nottingham     http://www.mnot.net/
Received on Monday, 30 July 2007 18:59:49 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 13 January 2011 12:15:37 GMT