举个例子,假设我已经按照如下方式设置了我的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未找到
意外的查询字符串参数:var2
Traceback(最近的通话):
文件 "C:\Python26\lib\site-packages\cherrypy_cprequest.py", 第606行, 在响应中 cherrypy.response.body = self.handler() 文件 "C:\Python26\lib\site-packages\cherrypy_cpdispatch.py", 第27行, in call test_callable_spec(self.callable, self.args, self.kwargs) 文件 "C:\Python26\lib\site-packages\cherrypy_cpdispatch.py", 第130行, 在test_callable_spec中 "parameters: %s" % ", ".join(extra_qs_params)) HTTPError: (404, 'Unexpected query string parameters: var2')由CherryPy 3.1.2提供支持