Trishul API MCQs with answers Page - 21

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. What happens if set_body() is called with null body?

  • (A) Returns false
  • (B) Throws NullPointerException
  • (C) Ignores the call
  • (D) Creates empty body

A

Admin • 833K Points
Coach

Q. Which method provides access to HTTP headers?

  • (A) headers()
  • (B) header()
  • (C) getHeaders()
  • (D) fetchHeaders()

A

Admin • 833K Points
Coach

Q. Which method is used internally to set headers?

  • (A) assign_header
  • (B) header_set
  • (C) set_header
  • (D) update_header

A

Admin • 833K Points
Coach

Q. Which method returns the Session object?

  • (A) get_session
  • (B) session
  • (C) session_data
  • (D) fetch_session

A

Admin • 833K Points
Coach

Q. Which method sets cookies internally?

  • (A) set_cookie
  • (B) assign_cookie
  • (C) cookie_set
  • (D) update_cookie

A

Admin • 833K Points
Coach

Q. What is passed to the constructor of Request?

  • (A) HTTP method
  • (B) URL
  • (C) Headers
  • (D) Body

A

Admin • 833K Points
Coach

Q. Which method sets path variables internally?

  • (A) set_path
  • (B) assign_path
  • (C) path_set
  • (D) update_path

A

Admin • 833K Points
Coach

Q. What is a key design note of the Request class?

  • (A) Properties are instance-based
  • (B) Properties are static
  • (C) Immutable design
  • (D) Thread-safe by default

A

Admin • 833K Points
Coach

Q. How should request data be accessed?

  • (A) Direct property access
  • (B) Using getter methods
  • (C) Using global variables
  • (D) Using constants

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