Question 16
Consider the following api resources created using flask_restful. Assume that the app is connected to the database and is running on one terminal. Select the correct option(s).
class TestApi(Resource): def get(self, admin): # retrieves admin data from database and returns it. return { "name": "mad1_admin", "role": "admin", }
def post(self): # fetches user data from request body and stores in the database. return { "message": "user added successfully" }, 201
api.add_resource(TestApi, "/api/<string:admin>", "/<admin>","/user_data", "/")
app.run()