How to read URL path values as parameter

530 views
Skip to first unread message

kshah

unread,
Mar 6, 2009, 10:04:29 AM3/6/09
to Google App Engine
I wanted to use
http://xyz.appspot.com/process/chicago/il
URL instead of
http://xyz.appspot.com/process?city=chicago&state=il

How do I convert these path values as GET parameters?

Thanks!

Bryan A. Pendleton

unread,
Mar 6, 2009, 12:04:15 PM3/6/09
to Google App Engine
You have (at least) 2 options:

1) Use the regexp in webapp to extract them, ie, your URL mapping:
....
("/process/([^/]+)/([^/]+)",MyProcessHandler),
...

Then MyProcessHandler.get() will get called with two extra arguments,
one set to each of the groups in the regexp

2) Parse path_info yourself. It's handed in as part of the webapp at
self.request.path_info


On Mar 6, 10:04 am, kshah <kunal.software.engin...@gmail.com> wrote:
> I wanted to usehttp://xyz.appspot.com/process/chicago/il
> URL instead ofhttp://xyz.appspot.com/process?city=chicago&state=il
Reply all
Reply to author
Forward
0 new messages