Intriguing. Never even occurred to me that something as simplistic as NOT
encoding might work.
This is great, but doesn't mesh nicely with the rest of REST, since of
course what I really want is:
/urls/{url}/foo/bar
And there would be no way to know where the end of the embedded URL was, and
the beginning of the rest of the route (/foo/bar) was:
http://localhost:9876/toto?url=http://www.example.com/foo.xml/foo/bar?a=1&b=
2
Cliff
> -----Original Message-----
> From: Jerome Louvel [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 10, 2008 2:25 AM
> To: [email protected]
> Subject: RE: routes with URIs
>
>
> Hi Cliff,
>
> I have just done a simple test, typing this URI in Firefox 3:
> http://localhost:9876/toto?url=http://www.example.com/foo.xml?a=1&b=2
>
> On the server, I just return as an entity the URI entered, which displayed
> exactly the same value in the browser.
>
> Then, I tried this:
> http://localhost:9876/toto/url/http://www.example.com/foo.xml?a=1&b=2
>
> And it displayed the same value again, both in FF3 and IE7. See attached
> server code.
>
> I guess you are encountering encoding issue at other levels. Maybe in your
> HTML page that is initially sent to your browser.
>
> Best regards,
> Jerome Louvel
> --
> Restlet ~ Founder and Lead developer ~ http://www.restlet.org
> Noelios Technologies ~ Co-founder ~ http://www.noelios.com
>
>
> -----Message d'origine-----
> De : Cliff Binstock [mailto:[EMAIL PROTECTED]
> Envoye : vendredi 31 octobre 2008 21:30
> A : [email protected]
> Objet : routes with URIs
>
> To all,
>
> Wondering if anyone has any experience or great ideas:
>
> I have a need to specify URLs (not the uri-pattern) when fetching
> Resources.
>
> A simple degenerate case is this:
>
> /urls/{url}
>
> Where {url} points to some random place on the web. While I have thought
> of
> a number of workarounds, I can't come up with an elegant solution. As a
> point of reference, a URL encoded URL doesn't seem to work with most
> browsers. You might, for example, think that this:
> http://www.example.com/foo.xml
> Might turn into this:
> http%3A%2F%2Fwww.example.com%2Ffoo.xml
> or more precisely, for the aforementioned route:
> /urls/http%3A%2F%2Fwww.example.com%2Ffoo.xml
>
> But again, most browsers (at least IE and Firefox) aren't happy about
> this.
>
> So far I've thought of solutions like:
> * POST
> * Require something besides "/" delimiter
> * Pre-cache using something else (with POST), like /specify-url ...
> * Use some sort of (non-standard) encoding
>
> Has anyone had to do anything similar? Or any ideas on a user-friendly
> solution?
>
>
> Thanks in advance,
>
> Cliff