All the elements of the URL after the controller and function are 
request.args (except the query string, of course). You could have a 
function called company(), and then companyid and storeid would be in 
request.args(0) and request.args(2), respectively. Or you might want a more 
general function, like api(), and then "company", companyid, "store", and 
storeid would be request.args[0:4]. If desired, you could hide the "api" 
function from the URL via routes.py.

Anthony

On Thursday, December 22, 2011 1:00:57 PM UTC-5, dum coder wrote:
>
> Hello everyone, i'm new to Python and web2py , In Java Jersey REST 
> framework i can map a REST URL to a function and get all the path 
> parameters eg., 
>
> /comapany/{comapnyid}/store/{storeid} 
>
> can be mapped to a particular function and companyid and storeid are 
> accessible as 
> parameters to function. 
>
> i'm trying to find how can i accomplish similar functionality in 
> web2py, where 
>
> GET /comapany/apple/store/567 
>
> gets mapped to a function and in side function i can retrieve 
> companyid and storeid variables. 
>
> I looked at function parse_as_rest but seems like it tried to run 
> query against db, in  my 
> case i just want to retrieve path parameters and then call other rest 
> api  in other systems 
>
>
> thanks 
>

Reply via email to