[英]Tornado 405 error POST method not allowed
I am trying to make a php login into tornado and when I click "Sign in" I am getting a page with an error saying "405 Method not allowed". 我试图让php登录龙卷风,当我点击“登录”时,我收到一个错误的页面,上面写着“405 Method not allowed”。
Here is my form: 这是我的表格:
<form method="POST">
<fieldset id="inputs">
<input name="username" id="username" required>
<input name="password" id="password" type="password" name="Password" placeholder="Password" required>
</fieldset>
<fieldset id="actions">
<input type="submit" id="submit" value="Log in" name="submit">
<label><input type="checkbox" checked="checked"> Keep me signed in</label>
</fieldset>
</form>
You need to add an action to your form and have a post method in your handler. 您需要向表单添加操作,并在处理程序中使用post方法。 If you set up a handler like:
如果你设置一个像这样的处理程序:
(r"/feedback", FeedbackHandler)
Which has a post method: 哪个有post方法:
def post(self):
#do something here
And a form which has: 并有一个表格:
<form action="/feedback" method="post" >
It should work. 它应该工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.