Last active
August 19, 2020 03:32
-
-
Save Ifihan/a9e23fc35a7b6e4077ba0b278be7d045 to your computer and use it in GitHub Desktop.
Using Flask-RESTful to build a basic REST API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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