I\'m making a RESTful WebService using CherryPy 3 but I encounter a problem : I want to be able to answer requests like : /customers/1/products/386 meaning I wa
Thanks for your answer Sylvain. You've led me to the answer I was looking for. I used the RouteDispatcher like this :
self.connect("cust_products", "/customers/{cust_id}/products/",
controller=CustomerController(),
action='index',
conditions=dict(method=['GET']))
self.connect("cust_products", "/customers/{cust_id}/products/{id}",
controller=CustomerController(),
action='show',
conditions=dict(method=['GET']))
self.connect("cust_products", "/customers/{cust_id}/products/",
controller=CustomerController(),
action='create',
conditions=dict(method=['POST']))
self.connect("cust_products", "/customers/{cust_id}/products/{id}",
controller=CustomerController(),
action='update',
conditions=dict(method=['PUT']))
self.connect("cust_products", "/customers/{cust_id}/products/{id}",
controller=CustomerController(),
action='delete',
conditions=dict(method=['DELETE']))