Question 9
Consider the following Python code snippet.
Filename: app.py
from flask import Flask, requestimport sysapp = Flask(__name__)
@app.route('/home', methods = sys.argv)def my_func(): if request.method == 'GET': return f"Hello from {sys.argv[1]} method"
elif request.method == 'POST': return f"Hello from {sys.argv[2]} method"
else: return "Please enter a valid HTTP method"
app.run(debug = True)If the above flask app is run using the command python app.py POST GET in one terminal, what will be the output on another terminal for command;
curl -X POST http://127.0.0.1:5000/home ?