问题
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