Answers for "flask restful for python 3"

0

how to import flask restful using pip

pip install Flask-RESTful
Posted by: Guest on August-19-2020
6

python flask rest api

from flask import Flask
from flask_restful import Resource, Api

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)
Posted by: Guest on March-27-2021

Python Answers by Framework

Browse Popular Code Answers by Language