客户端代码通过ajax请求将对象(在POST请求主体中)或查询字符串(如果使用GET方法)提交给Python cgi脚本。请注意,对象/查询字符串参数不是来自于一个。
<form> or <isindex>.
我如何使用标准库模块(例如,cgi)从服务器端Python脚本中检索这些参数?
Thanks very much
EDIT:
@codeape: Thanks, but wouldn t that work only for submitted forms? In my case, no form is being submitted, just an asynchronous request.
Using your script, len(f.keys()) returns 0 if no form is submitted! I can probably recast the request as a form submission, but is there a better way?