datatables pass headers on request 1

datatables pass headers on request

Plain text1234567'ajax': {    'url': url,    'type': 'GET',    'beforeSend': function (request) {        request.setRequestHeader("token", token);    }}

Here is what the above code is Doing:
1. The first line is the URL of the API.
2. The second line is the token that you need to pass in the header.
3. The third line is the data that you need to pass in the body.
4. The fourth line is the type of request.
5. The fifth line is the header that you need to pass.

Similar Posts