flask_restful用法1

from flask import Flask
from flask_restful import Api,Resource

app = Flask(__name__)
api = Api(app)

class HelloWorld(Resource):
    def get(self):
        return {‘hello‘: ‘world‘}

api.add_resource(HelloWorld, ‘/‘)

if __name__ == ‘__main__‘:
    app.run(debug=True)

flask_restful用法1

原文地址:https://www.cnblogs.com/heris/p/14650645.html