1

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.

Peter
  • 904
  • 1
  • 13
  • 26

1 Answers1

0

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);
};
  • Haha, exactly. I did the same thing. Later I moved all custom headers logic into JsonRestStore as we started to use that instead. Its really funny that dojo does not implement custom headers in data stores and widgets and other places where it counts. – Peter Apr 07 '11 at 13:08