Save without request

Hi, guys, how are you?
I can save without request POST, with AJAX, is possible?

i try this, but doesn’t work.

In my controller:

public function addAgrupador($categoria_id = null, $subcategoria_id = null)

        $newData[] = [
            'insumo_categoria_id'     => $categoria_id,
            'insumo_subcategoria_id'  => $subcategoria_id,
            'name' =>'teste',
            'cultura'=> 'Milho'

        $agrupadores = $this->CustosAgricolasAgrupadores->newEntity();
        $agrupadores = $this->CustosAgricolasAgrupadores->patchEntity($agrupadores, $newData);

        $this->set(compact('agrupadores', 'newData'));

and in my front-end i use JAVASCRIPT like this:

    function adicionarAgrupador() {
        name_agrupador = $('#name_agrupador').val();
        categoria_id = $('#categoria_id').val();
        subcategoria_id = $('#subcategoria_id').val();

        url = "<?= $this->Html->Url->build(['action' => 'addAgrupador']) ?>/" + categoria_id + "/" + subcategoria_id;
            url: url
        }).done(function(data) {

the $agrupadores variable with patchEntity returns this:

but not save, i need help.

Right in your variable dump, it tells you why. Name is required. Either provide a name when you make this entity, or change your validation so it’s not required.

You can also pass your $newData to newEntity($newData).