Trishul API MCQs with answers Page - 14

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 namespace contains MiddlewareInterface?

  • (A) TrishulApiCoreHttp
  • (B) TrishulApiCoreMiddleware
  • (C) TrishulApiCoreData
  • (D) TrishulApiCoreApp

A

Admin • 833K Points
Coach

Q. Which methods must be implemented in MiddlewareInterface?

  • (A) handle() and process()
  • (B) handle_request() and handle_response()
  • (C) before() and after()
  • (D) request() and response()

A

Admin • 833K Points
Coach

Q. When is handle_request() executed?

  • (A) After response is sent
  • (B) Before controller logic
  • (C) During DB connection
  • (D) After logging

A

Admin • 833K Points
Coach

Q. When is handle_response() executed?

  • (A) Before request arrives
  • (B) After request validation
  • (C) Before response is sent to client
  • (D) Before DB query

A

Admin • 833K Points
Coach

Q. What must handle_request() return?

  • (A) Boolean
  • (B) Request object
  • (C) Response object
  • (D) String

A

Admin • 833K Points
Coach

Q. What must handle_response() return?

  • (A) Boolean
  • (B) Request object
  • (C) Response object
  • (D) Array

A

Admin • 833K Points
Coach

Q. What happens if middleware does not return Request/Response?

  • (A) Nothing happens
  • (B) Breaks middleware chain
  • (C) Auto-fix applied
  • (D) Ignored

A

Admin • 833K Points
Coach

Q. Which operation is suitable for handle_request()?

  • (A) Add response header
  • (B) Authenticate user
  • (C) Send JSON response
  • (D) Close DB connection

A

Admin • 833K Points
Coach

Q. Which operation is suitable for handle_response()?

  • (A) Validate input
  • (B) Modify response headers
  • (C) Fetch DB data
  • (D) Parse request body

A

Admin • 833K Points
Coach

Q. What does middleware chaining mean?

  • (A) Multiple DB queries
  • (B) Multiple middleware executed sequentially
  • (C) Multiple APIs combined
  • (D) Parallel execution

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