Dojo Data Grid with Custom HTTP Headers

I have a DataGrid that connects to a REST service. I need to pass some custom HTTP headers (authorization and others) to retrieve the operation. How can i do this?

The data warehouse is JsonRestStore.

+1
source share
1 answer

Better late than never ... Here's a workaround; add this function at the beginning of the dojo.addOnLoad () method.

dojo.xhrGet = function(args){// Workaround for Dojo lack of support for custom headers args.headers = {userId:'xyz', requestedBy:'abc', requestedFrom:'123'}; return dojo.xhr("GET", args); }; 
0
source

Source: https://habr.com/ru/post/1403050/


All Articles