Complete Guide on Rest API with Python and Flask

PHOTO EMBED

Wed Mar 02 2022 20:58:03 GMT+0000 (UTC)

Saved by @morristech #python

from flask import Flask

from flask_restful import Resource, Api

app = Flask(__name__)

api = Api(app)

class Helloworld(Resource):

	def __init__(self):

		pass

	def get(self):

		return {

			"Hello": "World"

		}

api.add_resource(Helloworld, '/')

if __name__ == '__main__':

	app.run(debug=True)
content_copyCOPY

https://www.analyticsvidhya.com/blog/2022/01/rest-api-with-python-and-flask/