Magento 2 Custom Module: POST Request Redirects Instead of Hitting Controller

Custom Magento 2 module POST request yields an HTTP 302 redirect, so the controller logic is not invoked. See sample snippet below:

<?php
namespace Acme\Module\Controller\Action;

use Magento\Framework\App\Action\Action;

class Process extends Action {
    public function execute() {
        // Custom processing logic here
        return 'Request processed.';
    }
}

hey, im curious if a misconfigured route or ctrl regstration might be causing the 302? maybe form key issues too? have u checked log errors? what else might trigger this behaviour in your experiance?

In my experience, another probable cause for the 302 redirect is returning an incorrect or incomplete response in the execute method. Magento expects a valid response object such as a ResultRedirect or a ResultPage. Returning plain text may inadvertently trigger a redirection. I resolved a similar issue by using the appropriate result factory to generate a proper Page or JSON response. It helped to enable developer mode to capture detailed error messages that guided the adjustments in the controller logic.

hey, check if cachng or frm key issues are triggerring the redir. i had similar probs once and correcting the respnse object via the result factory solved it. good luck!