我的网页表单如下:
<form action="/process_form/" method="post">
<input type="text" name="login" value="login" />
<input type="text" name="password" value="123" />
<input type="submit" />
</form>
处理此问题的python类是:
class Handle:
@cherrypy.expose()
#@cherrypy.tools.post <-- Is something like this possible
def index(self, login=None):
print(login)
CherryPy中是否有办法将对/process_form/
的调用限制为POST方法?我的意思是如果用户输入http://www.example.com/process_form/
他/她应该得到异常/错误或找不到页面?