1

I'm trying to use the :path wildcard filter (as described here) to match part of my URL, which includes a forward slash character. For example, if I have the URL:

/resources/adfs89s7/container/asdf%2Fasdf/items

(where %2F is the forward slash), I want to match it to the route:

/resources/<resource_id>/container/<container_name:path>/items

However, this is currently returning a Not Found error. I have similar URLs where the wildcard filter is at the end of the URL, e.g.

/resources/<resource_id>/container/<container_name:path>

and that seems to work fine. Does anyone know what could be going on?

1
  • If the container name is escaped, why are you using path? There's no need. Mar 4, 2015 at 15:11

1 Answer 1

0

From your example, it looks like your container names are escaped (as they should be). In that case, you don't need the path type specifier in the Bottle route. I.e., you want this:

/resources/<resource_id>/container/<container_name>/items

Also keep in mind that the above route will not match paths with a trailing slash, so if this is intended to be a RESTful browsing API, then you may want to make the route:

/resources/<resource_id>/container/<container_name>/items/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.