Dojo Data grid with custom HTTP headers

牧云@^-^@ 提交于 2019-12-11 08:15:00

问题


I have DataGrid that connects to REST service. I need to pass some custom HTTP headers (Authorization and others) to fetch operation. How can I do that?

Data store is JsonRestStore.


回答1:


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's lack of support for custom headers
   args.headers = {userId:'xyz', requestedBy:'abc', requestedFrom:'123'};
   return dojo.xhr("GET", args);
};


来源:https://stackoverflow.com/questions/2699536/dojo-data-grid-with-custom-http-headers

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!