Trishul API MCQs with answers Page - 18

Here, you will find a collection of MCQ questions on Trishul API . Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833K Points
Coach

Q. Which method creates a JSON response object?

  • (A) out()
  • (B) json()
  • (C) send()
  • (D) response()

A

Admin • 833K Points
Coach

Q. Which method sends response and terminates execution?

  • (A) json()
  • (B) send()
  • (C) out()
  • (D) flush()

A

Admin • 833K Points
Coach

Q. What is the default return type of Response?

  • (A) XML
  • (B) HTML
  • (C) JSON
  • (D) TEXT

A

Admin • 833K Points
Coach

Q. What happens if unsupported return type is passed to out()?

  • (A) Ignored
  • (B) Default JSON used
  • (C) InvalidResponseTypeException thrown
  • (D) Warning logged

A

Admin • 833K Points
Coach

Q. What is the visibility of Response constructor?

  • (A) public
  • (B) protected
  • (C) private
  • (D) static

A

Admin • 833K Points
Coach

Q. Why is constructor private?

  • (A) To restrict usage
  • (B) To enforce static factory methods
  • (C) To improve performance
  • (D) To avoid inheritance

A

Admin • 833K Points
Coach

Q. Which method is used to access headers?

  • (A) header()
  • (B) get_header()
  • (C) headers()
  • (D) set_header()

A

Admin • 833K Points
Coach

Q. Which method is used to access cookies?

  • (A) cookie()
  • (B) get_cookie()
  • (C) set_cookie()
  • (D) cookies()

A

Admin • 833K Points
Coach

Q. Which method is used to set cookies?

  • (A) add_cookie()
  • (B) set_cookie()
  • (C) cookie_set()
  • (D) put_cookie()

A

Admin • 833K Points
Coach

Q. Which method is used to access session?

  • (A) session()
  • (B) get_session()
  • (C) set_session()
  • (D) session_get()

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ