Any way to swap out the "ajax" object for a custom object/function?
Any way to swap out the "ajax" object for a custom object/function?
I'm currently writing a VueJS application that includes some DataTables. The basic tables work fine when the server requires no "Authorization". However, as you can imagine, most data resources in the app require some sort of auth. That said, I'm currently using Axios for all other HTTP needs. Is there any way to "swap" the DataTables ajax object (on a per-instance basis) for another object/function (i.e. Axios)?
NOTE: I realize DataTables supposedly supports header manipulation, but everything I see points to "ajax.data" without any details or examples. Also, replacing the ajax object outright would work nicely with my current, already-authorized Axios setup.
This question has an accepted answers - jump to answer
Answers
Ended up using the following:
This basically copied the pre-set headers from the VueJS "global" axios instance.
Looks good - thanks for posting back!
Allan