Trishul API MCQs with answers Page - 3

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 should be called at the end of index.php?

  • (A) init()
  • (B) boot()
  • (C) start()
  • (D) run()

A

Admin • 833K Points
Coach

Q. Which class is used to create routes?

  • (A) App
  • (B) Router
  • (C) Request
  • (D) Logger

A

Admin • 833K Points
Coach

Q. How do you define a GET route in Trishul API?

Code:
Router::get('/hello', ["hello"=>"world"]);
  • (A) Router::create('/hello')
  • (B) Router::post('/hello')
  • (C) Router::get('/hello', [...])
  • (D) Router::route('/hello')

A

Admin • 833K Points
Coach

Q. Which class provides access to HTTP request data?

  • (A) Response
  • (B) Request
  • (C) Router
  • (D) DB

A

Admin • 833K Points
Coach

Q. How is the Request object provided to controllers?

  • (A) Manually instantiated
  • (B) Injected automatically via constructor
  • (C) Fetched from global variable
  • (D) Loaded via config file

A

Admin • 833K Points
Coach

Q. Which method retrieves request headers?

  • (A) body()
  • (B) query_params()
  • (C) header()->get()
  • (D) getHeaders()

A

Admin • 833K Points
Coach

Q. Which class is used to send JSON responses?

  • (A) Request
  • (B) Response
  • (C) Router
  • (D) Logger

A

Admin • 833K Points
Coach

Q. Which method is used to return JSON response?

Code:
Response::json(HttpStatus::OK, [...])
  • (A) Response::send()
  • (B) Response::json()
  • (C) Response::output()
  • (D) Response::return()

A

Admin • 833K Points
Coach

Q. Which class is used for logging?

  • (A) Logger
  • (B) LoggerFactory
  • (C) LogManager
  • (D) Debug

A

Admin • 833K Points
Coach

Q. Which logging level method is NOT mentioned?

  • (A) info()
  • (B) warn()
  • (C) error()
  • (D) debug()

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