POST-Language

Report a typo

Create the POST method to the following list of programming languages API that receives a JSON file ({"name":name}) and adds it as a dictionary to the languages list and returns the new list.

Write a program in Python 3
app = Flask("main")
languages = [{"name": "python"}, {"name": "c++"}]


class Language(MethodView):
def get(self):
return jsonify(languages)
#add your code here
language_view = Language.as_view("language_api")
app.add_url_rule("/language", methods="GET", view_func=language_view)
___

Create a free account to access the full topic