Skip to content

Instantly share code, notes, and snippets.

@Ifihan
Last active August 19, 2020 03:32
Show Gist options
  • Save Ifihan/a9e23fc35a7b6e4077ba0b278be7d045 to your computer and use it in GitHub Desktop.
Save Ifihan/a9e23fc35a7b6e4077ba0b278be7d045 to your computer and use it in GitHub Desktop.
Using Flask-RESTful to build a basic REST API
from flask import Flask
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
class Student(Resource):
def get(self, name):
return {"student": name}
api.add_resource(Student, "/student/<string:name>/")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment