Flask MethodView 使用教程:创建 RESTful API
from flask.views import MethodView
class MyView(MethodView): def get(self): return 'GET method'
def post(self):
return 'POST method'
def put(self):
return 'PUT method'
def delete(self):
return 'DELETE method'
app.add_url_rule('/myview', view_func=MyView.as_view('myview'))
原文地址: https://www.cveoy.top/t/topic/pTRU 著作权归作者所有。请勿转载和采集!