In the google engine, how to iterate through form fields (python, wsgiref.handlers)

Using python and wsgiref.handlers, I can get one variable from the form with self.handler.request.get (var_name), but how can I iterate over all form variables, be they from GET and POST? Is it something like this?

for the field in self.handler.request.fields:
  value = self.handler.request.get (field)

Again, it should include both the fields included in the POST and the fields from the query string, as in the GET request.

Thanks in advance guys ...

+3
source share
2 answers

http://code.google.com/appengine/docs/python/tools/webapp/requestclass.html#Request_arguments

for field in self.request.arguments():
  value = self.request.get(field)
+5
source

:

params = {}
for field in self.request.arguments():
  params[field] = self.request.get(field)
0

Source: https://habr.com/ru/post/1748669/


All Articles