使用 python 和 wsgiref.handlers,我可以使用 self.handler.request.get(var_name) 从表单中获取单个变量,但是如何遍历所有表单变量,无论是来自 GET 还是 POST?是这样的吗?
对于 self.handler.request.fields 中的字段:
value = self.handler.request.get(字段)
同样,它应该包括 POST 中包含的字段和查询字符串中的字段,就像在 GET 请求中一样。
在此先感谢大家...
最佳答案
http://code.google.com/appengine/docs/python/tools/webapp/requestclass.html#Request_arguments
for field in self.request.arguments():
value = self.request.get(field)
关于python - 在谷歌应用引擎中,如何遍历表单字段(python,wsgiref.handlers),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2981078/