Question 27
Consider a flask application given below.
File 1: main.py
from flask import Flask
app = Flask(__name__)
@app.route('/about', methods=['GET'])def hello_world(): return '<p>Hello, World!</p>'
@app.route('/home/', methods=['POST'])def home(): return '<h1>You are now on home page</h1>'
if __name__=='__main__': app.run(debug=True)Which of the following statements is/are true, if the above flask application is running on the URL “http://127.0.0.1:5000/”?
Whenever we hit the URL “http://127.0.0.1:5000/about/”, the browser will show “404 Not found” error.
Whenever we hit the URL “http://127.0.0.1:5000/about/”, the browser will display “Hello, World!”.
Whenever we hit the URL “http://127.0.0.1:5000/home/” using the browser, it will show “Method Not Allowed” error.
Whenever we hit the URL “http://127.0.0.1:5000/home/” using the browser, it will display “You are now on home page”.