【发布时间】:2010-01-03 01:33:47
【问题描述】:
例如,假设我的 Cherrypy 索引模块是这样设置的
>>> import cherrypy
>>> class test:
def index(self, var = None):
if var:
print var
else:
print "nothing"
index.exposed = True
>>> cherrypy.quickstart(test())
如果我发送多个 GET 参数,我会收到此错误
404 未找到
意外的查询字符串参数: 变量2
回溯(最近一次通话最后一次):
文件 "C:\Python26\lib\site-packages\cherrypy_cprequest.py", 第 606 行,作为回应 cherrypy.response.body = self.handler() 文件 "C:\Python26\lib\site-packages\cherrypy_cpdispatch.py", 第 27 行,在 调用 test_callable_spec(self.callable, self.args, self.kwargs) 文件 "C:\Python26\lib\site-packages\cherrypy_cpdispatch.py", 第 130 行,在 test_callable_spec "参数: %s" % ", ".join(extra_qs_params)) HTTPError: (404, '意外的查询字符串 参数:var2')由 CherryPy 3.1.2 提供支持
【问题讨论】:
-
请不要接受我的回答并接受 Coady 的正确回答,以便我删除我的。