Search code examples
extjsextjs4extjs4.1

Adding header to Ajax request


How can I add a request header to an ExtJS ajax request?

I specifically want to add the header: accept-encoding to equal true.


Solution

  • You can specify request headers like this:

    Ext.Ajax.request({
        url: 'yourUrl',
        headers: {
            'accept-encoding': 'true'
        }
    })​