未找到 Tornado Post 方法

编程入门 行业动态 更新时间:2024-10-27 18:31:42
本文介绍了未找到 Tornado Post 方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在尝试在 Tornado 网络服务器中发布表单,但每当我单击提交时,都会生成以下错误

I'm trying to post a form in Tornado web server but whenever I click submit the following error generates

405 方法不允许

这是表格

<form method="post">
  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  <input type="submit" value="Submit">
</form>

我尝试将主请求处理程序上的get"方法更改为post",但它不起作用.唯一有效的方法是 GET,

I've tried changing the "get" method on the main Request Handler to "post" but it doesn't work. The only method that works is GET,

class MainHandler(BaseHandler):
    """
    Main request handler for the root path and for chat rooms.
    """

    @tornado.web.asynchronous
    def get(self, room=None):

有什么建议吗?

推荐答案

在那段漫长的聊天窗口之后,我发现最适合您的方法是通过 cookie 传输数据.

After that long window of chat I've figured that the best method for you specifically is to transfer the data through cookies.

这是一个教程:http://www.w3schools/js/js_cookies.asp

另一种资源是将您的数据分解为多个部分.

An alternative resource is to breakdown your data into multiple parts.

一种方法是向为您分配唯一 ID 的端点发出请求.然后以 ?id=XXX&page=1&data=... 的形式发送一系列请求,然后用 ?id=XXX&total_pages=27 关闭它此时您将在服务器上组装不同的部分.

One approach would be to make a request to an end point that allocates you a unique ID. Then send a series of requests in the form: ?id=XXX&page=1&data=... before closing it with ?id=XXX&total_pages=27 at which point you assemble the different pieces on the server.

这篇关于未找到 Tornado Post 方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-30 02:51:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1388250.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:未找到   方法   Tornado   Post

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!