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.
Class Based Views
POST-Language
Report a typo
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)
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.