[英]Flask restful API urls
我在我的項目中使用Flask-RESTful( http://flask-restful.readthedocs.org/en/latest/index.html )。 閱讀一些示例后,我了解到我的Resource類中只有get,post,update等方法。 如何使用獨特的網址制作自己的Resource類方法,就像使用@ app.route()裝飾器在Flask中那樣? 謝謝。
希望對您有所幫助
@app.route('/', methods=['GET', 'POST'])
def index():
if request.method == 'GET':
pass
elif request.method == 'POST':
pass
else:
pass
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.