Read More
Read More
Menu Close

    Creating POST Method Controller in Magento 2.3

    In Magento 2.3, a POST method controller can be created by implementing Magento\Framework\App\Action\HttpPostActionInterface.
    But If we have lots of POST controllers in our Module, then there will need to implement this Interface in all Controllers.
    So, In this article, we will explain to you an easy and efficient way to create POST controllers in Magento 2.3.
    Firstly, create an ApiController Class, which is implementing \Magento\Framework\App\CsrfAwareActionInterface and in this class, we have implemented two methods named as createCsrfValidationException and validateForCsrf.

    Then, we extend the ApiController class in our POST/GET method controllers.

    I hope It will help you. Thanks 🙂 🙂

    Previous Blog: Profiler in Magento 2

    Next Blog: Display collection records in a specific order except for DESC or ASC sort order

    Searching for an experienced
    Magento 2 Company ?
    Read More
    . . .
    Discuss on Helpdesk

    Leave a Comment

    Your email address will not be published. Required fields are marked*


  • keon
    • khushboo sahu (Moderator)
      Most Welcome 🙂
  • Back to Top