How can we add custom header to the http call?
dataSource: { dataSourceType: "ocsv", /* URL to the Data Compressor .NET */ filename: "http://localhost:55772/api/flexmonster/get"
In the above snippet, as flexmonster calls the URL, I need to add custom header to this URL. How can this be achieved?
I have tried to append using following snippet,
$(document).ajaxSend(function (event, jqxhr, settings) {
jqxhr.setRequestHeader('custom', 'new-value')
});
but it doesn't work.
Thanks
Hello Amandeep,
Thank you for your question. Please have a look at the following thread - http://www.flexmonster.com/question/how-to-set-authorization-in-the-request-of-webapi/. You can find the answer to the similar question there.
Please let us know if you have any additional questions here.
Regards,
Dmytro.