How to add meta headers to dhtmlx ajax helper requests


I am not sure if this falls into dhtmlx form but its related to

What I’m trying to achieve is to add the following csrf header to ajax requests

In jquery, the example shown in the website works.
How do I make sure the meta headers are added in the requests ??

Check the query API

dhx4.ajax.query({ method:"POST", url:"some.php", headers:{ "some-csrf":"value" } });

Brilliant. Thank you

Dear sir,

I follow you example, but I can not get value, can you tell me where i miss.
–js file–
data: “id1=”+treeId,
“X-CSRF-TOKEN”:"<?php echo csrf_token(); ?>"


public function gtreeDelete(Request $request){

    $id1 = 0;

    $id1 = $request->input('id1');
    $result = DB::table('USRAB')
            ->where('AB001', $id1)
                'AB020' => 0
    return 'success';


– SQL result–
update [USRAB] set [AB020] = ‘0’ where [AB001] is null

thank you a lot


Try to use

headers:{ "X-CSRF-TOKEN":"<?php echo csrf_token(); ?>", "Content-Type": "application/x-www-form-urlencoded" }

thank you , sir