Quiz Space

Modern Application Development I · Quiz 2 · 1 Dec 2024 · September 2024 term

Question 12: What will be returned on the terminal 2 for the command:

Question 12

+3 marksOne correct option

Consider the following resource created using Flask, assume that the application is running on a terminal 1 and being accessed using CURL on terminal 2. Answer the given subquestions.

python
from flask_restful import Api, Resource
from flask import Flask
app = Flask(__name__)
api = Api(app)
class TestApi(Resource):
def get(self):
# logic to retrieve data from backend
return {
"val1": "value1",
"val2": "value2",
"val3": "value3"
}
def delete(self, val):
# logic to delete the value from data w.r.t "val" argument provided
return {
"message": "Value deleted successfully",
"value": val
}, 200
def put(self, val):
# logic to update the value from data w.r.t "val" argument provided
return {
"message": "Value updated successfully",
"value": val
}, 200
api.add_resource(TestApi, '/get_values', '/delete/<val>', '/update/<val>')
app.run()

What will be returned on the terminal 2 for the command:

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 12 of 16 in the IIT Madras BS Modern Application Development I (MAD 1) Quiz 2 paper sat on 1 Dec 2024, in the September 2024 term (IIT M DIPLOMA AN EXAM QDD2 01 Dec 2024). It carries 3 marks.

More questions from this paper

  1. Q1You have a DRAM module with bus width of 64 bits, clock speed of 800 MHz, and operating in DDR (double-data-rate or two…
  2. Q2Figure question
  3. Q3Consider the following python code. Consider that the above code is running locally on “http://127.0.0.1:5000”. What wi…
  4. Q4Consider the following flask application. app.py Which of the following statements is/are true if the application is ru…
  5. Q5Consider the following flask application. app.py Which of the following statements is/are true if the application is ru…
  6. Q6Consider the following HTML document “form.html” and the flask route given in “app.py”. Assume all the required methods…
  7. Q7Consider the following flask code. If the flask server is running locally on “http://127.0.0.1:5000/”. Which of the fol…
  8. Q8Consider the flask code below. Assume that the above flask application is running on http://127.0.0.1:5000. Which of th…
  9. Q9Consider a character set Q, which consists of only those characters used in the sentence, "the five boxing wizards jump…
  10. Q10We are trying to create two models ‘Student’ and ‘Assignment’ and they are related by one-to- many relationship(i.e., o…
  11. Q11What will be returned on the terminal 2 for the command:
  12. Q13Which of the following statements are correct?
  13. Q14Identify the correct order of tasks that take place when a client makes a request on the URL: https://example.com/home.…
  14. Q15Consider the following statements and select the correct option.\ Statement 1: Redundancy is used to improve performanc…
  15. Q16The term “stateless” in the context of a server means that _