ExamGecko
Question list
Search
Search

Question 15 - AD0-E711 discussion

Report
Export

A developer has been tasked to create a new controller for custom functionality. Only GET HTTPrequests must be allowed. What must be done so the controller processes only GET requests?

A.
Use the REQUEST class constant to specify the request.
Answers
A.
Use the REQUEST class constant to specify the request.
B.
Ensure the controller class Implements Magento\Framework\App\Action\HttpGetActionlnterface.
Answers
B.
Ensure the controller class Implements Magento\Framework\App\Action\HttpGetActionlnterface.
C.
Ensure the controller extends the Magento\Framework\App\Action\AbstractGetController.
Answers
C.
Ensure the controller extends the Magento\Framework\App\Action\AbstractGetController.
Suggested answer: B

Explanation:

To make sure the controller processes only GET requests in Magento, you must ensure that the controller class implements the Magento\Framework\App\Action\HttpGetActionInterface. This interface enforces that the controller only processes GET requests, rejecting any other HTTP request methods.

asked 02/10/2024
Sebasteen Lawrance
43 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first