Question 13
Consider the following Python code snippet.
Filename: server.py
from flask import Flask, requestimport sys
app = Flask(__name__)
@app.route('/api/data', methods=sys.argv[1:])def handle_data(): if request.method == 'GET': return "<h1>Data retrieved successfully</h1>" elif request.method == 'PUT': return "<h1>Data updated successfully</h1>" elif request.method == 'DELETE': return "<h1>Data deleted successfully</h1>" else: return "<h1>Unsupported operation</h1>"
app.run(debug=True)Based on the above data, answer the given subquestions.