Hey, all-

I'm using Restlet 2.1RC2. I have a search resource that is working fine, except 
we came across a case where the search term has a '/' character in it. 

I'm already expecting the search terms to come in URL encoded, and the request 
that's being sent (to search for "a/b" for example) looks like: /search/a%2Fb

This is not being routed into my code at all, as far as I can tell based on 
debug logging - curl says the server is returning a 400 ("Bad Request"), 
although I don't see it in the server logs.  I have tried modifying the route 
explicitly to support '/' characters, like so:
TemplateRoute searchTemplate = router.attach("/search/{search_terms}", 
SearchResource.class);
searchTemplate.getTemplate().getVariables().put("search_terms", new 
Variable(Variable.TYPE_URI_PATH));

This also is not working with the encoded '/'.  (Also, I didn't think I needed 
to do this anyway, when the '/' character is encoded.)  In fact, in running 
some tests, it turns out that using this code I can get the query routed if 
it's sent as  "/search/a/b".  I don't really want to do this though, because 
there are other characters we're encoding...

As a workaround I'm going to propose that the client app replace '/' characters 
with some other special character. But does anyone have any idea why I'm seeing 
this odd behavior?

Thanks!

--------------------------
John Wismar
Alldata Technology
916-478-3296

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2923051

Reply via email to