Daily Archives: September 28, 2008

Google App Engine: Printing out all the Request Parameters

I figured out how to print all the request parameters in Google App Engine:

logging.info(self.request.params.items);

It looks like this:

bound method UnicodeMultiDict.items of UnicodeMultiDict([(u’A’, u’3′), (u’b’, u’4′)])

Along the way, I found useful information by making a dir() of the request object:

logging.info(dir(self.request))

[‘GET’, ‘POST’, ‘ResponseClass’, ‘__class__’, ‘__delattr__’, ‘__dict__’, ‘__doc__’, ‘__getattr__’, ‘__getattribute__’, ‘__hash__’, ‘__init__’, ‘__module__’, ‘__new__’, ‘__reduce__’, ‘__reduce_ex__’, ‘__repr__’, ‘__setattr__’, ‘__str__’, ‘__weakref__’, ‘_body__del’, ‘_body__get’, ‘_body__set’, ‘_body_file__del’, ‘_body_file__get’, ‘_body_file__set’, ‘_cache_control__del’, ‘_cache_control__get’, ‘_cache_control__set’, ‘_environ’, ‘_environ_getter’, ‘_headers’, ‘_headers__get’, ‘_headers__set’, ‘_host__del’, ‘_host__get’, ‘_host__set’, ‘_urlargs__del’, ‘_urlargs__get’, ‘_urlargs__set’, ‘_urlvars__del’, ‘_urlvars__get’, ‘_urlvars__set’, ‘accept’, ‘accept_charset’, ‘accept_encoding’, ‘accept_language’, ‘application_url’, ‘arguments’, ‘blank’, ‘body’, ‘body_file’, ‘cache_control’, ‘call_application’, ‘charset’, ‘content_length’, ‘content_type’, ‘cookies’, ‘copy’, ‘copy_get’, ‘date’, ‘decode_param_names’, ‘environ’, ‘get’, ‘get_all’, ‘get_range’, ‘get_response’, ‘headers’, ‘host’, ‘host_url’, ‘if_match’, ‘if_modified_since’, ‘if_none_match’, ‘if_range’, ‘if_unmodified_since’, ‘is_xhr’, ‘max_forwards’, ‘method’, ‘params’, ‘path’, ‘path_info’, ‘path_info_peek’, ‘path_info_pop’, ‘path_qs’, ‘path_url’, ‘postvars’, ‘pragma’, ‘query’, ‘query_string’, ‘queryvars’, ‘range’, ‘referer’, ‘referrer’, ‘relative_url’, ‘remote_addr’, ‘remote_user’, ‘remove_conditional_headers’, ‘request_body_tempfile_limit’, ‘scheme’, ‘script_name’, ‘server_name’, ‘server_port’, ‘str_GET’, ‘str_POST’, ‘str_cookies’, ‘str_params’, ‘str_postvars’, ‘str_queryvars’, ‘unicode_errors’, ‘uri’, ‘url’, ‘urlargs’, ‘urlvars’, ‘user_agent’]

logging.info(dir(self.request.params))

[‘__cmp__’, ‘__contains__’, ‘__delitem__’, ‘__doc__’, ‘__getitem__’, ‘__init__’, ‘__iter__’, ‘__len__’, ‘__module__’, ‘__repr__’, ‘__setitem__’, ‘_decode_key’, ‘_decode_value’, ‘add’, ‘clear’, ‘copy’, ‘decode_keys’, ‘dict_of_lists’, ‘encoding’, ‘errors’, ‘get’, ‘getall’, ‘getone’, ‘has_key’, ‘items’, ‘iteritems’, ‘iterkeys’, ‘itervalues’, ‘keys’, ‘mixed’, ‘multi’, ‘pop’, ‘popitem’, ‘setdefault’, ‘update’, ‘values’]