<?php
namespace modules\myform\controllers;

use Craft;
use craft\web\Controller;
use yii\web\Response;

// [module/controller/action]

class MyController extends Controller
{
    
    public  array|int|bool  $allowAnonymous = true; #set this.

    public function actionIndex(): Response
    {
        $request = Craft::$app->getRequest();
        $data = $request->getBodyParams();
        return $this->asJson($data);
    }
}
