Consider the following code – from flask import Flask, req…
Consider the following code – from flask import Flask, requestapp = Flask(__name__) @app.route(“/dashboard1″, methods=[‘GET’, ‘POST’])def update(): if request.method == ‘POST’: data = request.form.get(‘data’) if data: return f”Post request has been received with data: {data}” return f”Post request has been received, but no data provided yet.” html = “”” Dashboard Welcome to the dashboard. Submit some fun facts here “”” return html @app.route(“/submit”, methods=[‘POST’])def submit(): data = request.form.get(‘data’) if data: return f”Data received: {data}” return “No data received” if __name__ == “__main__”: app.run() Which of the following status code will be returned if we send the underneath request? curl -X POST http://127.0.0.1:5000/dashboard1 -d “data=There are approximately 8 billion people on Earth.”
Read Details