Python Flask REST API Tutorial
I am sharing my Python code to create simple REST API. I have used Python's lightweight framework Flask is used to create simple REST API. Flask Restful is an extension of Flask. This code may helpful for some beginner Python developer.
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)