[英]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.