python 3.x - Redirect request to different Resource(Falcon) -


i using python3.4 , falcon1.0 . want redirect request resource in falcon api.

for example, have 2 resources:

class res1(object):     def on_get(self, req, resp):         print("i'm on resource 1")         resp.status = falcon.http_200  class res2(object):     def on_get(self, req, resp):         print("i'm on resource 2")         resp.status = falcon.http_200 

and api url format localhost/{id}. want call res1 if id 1 else res2.

exception falcon.httpmovedpermanently(location) 

you can try or explain more


Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -