Webdev module access request object key

Hi;

In a webdev script that responds to a post i would like to access the params in the request object.

I use

logger = system.util.getLogger(“webdevPost”)
logger.info(str(request.keys()))

and can see

[u’headers’, u’scheme’, u’remoteHost’, u’params’, u’servletRequest’, u’remainingPath’, u’servletResponse’, u’context’, u’remoteAddr’]

in the logs.

I’ve tried

request[‘params’]

but, the result is

{‘event_1531f4ba-26d1-405e-bc63-f7b1b4bd4b26’: u’’}

How do I access request[‘params’] but only get

‘event_1531f4ba-26d1-405e-bc63-f7b1b4bd4b26’?

Can you include the full code section you’ve written for this?

Without seeing more detail my of the cuff guess is you need to use a for loop to iterate through the list that you get back when you request the params? Otherwise it’s displaying just the first element of the list.

request[‘params’] returns a dictionary; to get the keys use:

for param in request['params'].keys(): print 'key: %s' % param print 'value: %s' % request['params'][param]