Python Flask PUT and DELETE Methods when submitting HTML Form

匆匆过客 提交于 2021-02-08 08:20:20

问题


I have 2 forms on an HTML page with the same action URL (e. g. action = "/example"). In my Python Flask .py file, I have 2 routes with the same url, but I want 1 route to have the PUT method and the other to have the DELETE method (e. g. @app.route('/example'), methods=['PUT'] vs. @app.route('/example'), methods=['DELETE']). How can I do that? I have visited multiple websites and some examples I have seen include using jQuery or hidden inputs (e. g. ), but so far, these examples do not work.

来源:https://stackoverflow.com/questions/55320031/python-flask-put-and-delete-methods-when-submitting-html-form

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!