PDA

View Full Version : Adding HTTP Headers to Direct Requests



dancablam
28 Aug 2009, 8:44 AM
Anyone know if it's possible to add HTTP headers to a Direct Request? I know it can be done to AJAX requests but after flipping through the source I couldn't find how it can be done for Direct requests. Any suggestions?

Thanks,
Dan

dancablam
28 Aug 2009, 9:17 AM
Figured it out. Once again the Ext team made it so easy that I completely overlooked it. :)

Since Ext.Ajax is a singleton and Direct relies on Ext.Ajax, HTTP headers can be added directly to Ext.Ajax either by the defaultHeaders param:


Ext.Ajax.defaultHeaders = {
'Powered-By': 'Ext'
};

Or during the firing of an event like 'beforerequest', etc.