How to send parameter prior to ajax in datatable?

How to send parameter prior to ajax in datatable?

mastersusemastersuse Posts: 61Questions: 28Answers: 0
edited May 2020 in Free community support

I want to send some parameter with POST method prior to send to datatables ajax. How to do that?

this is the sample of parameter that require to be send prior ajax

{
  "uid": "4",
  "tokenid": "abc123",
  "item": "user",
  "action": "read",
  "type": "1",
  "keyword": ""
}
$('#testTable').DataTable({
    ajax: { 
        url: api_url',
        crossDomain : true,
        type : "POST",
        cache : false,
        dataType : "json",
        contentType: "application/json",
        dataSrc : "data",
    },
    columns: [
        { data : "fullname" },
        { data : "userid" },
        { data : "level" }
    ],
});

Answers

This discussion has been closed.