link data

11 views
Skip to first unread message

Rita Morgan

unread,
May 11, 2012, 8:08:52 AM5/11/12
to cherrypy-users
Hello,

How does one get and post data in cherrypy? for example, I have a link
link.html?user=foo now in link.html how can I handle user=foo?

An example would be much appreciated.

Eugene Van den Bulke

unread,
May 11, 2012, 8:14:53 AM5/11/12
to cherryp...@googlegroups.com
Hi Rita,

If in your cherrypy application you have a link method

@cherrypy.expose
def link(self, user):
return user

then GETting http://URL/link?user=foo OR http://URL/link/foo AND
POSTing user=foo to http://URL/link will return a page containing foo

HTH

--
EuGeNe -- follow me http://twitter.com/3kwa
Reply all
Reply to author
Forward
0 new messages