Adding header to Ajax request

Robo picture Robo · Aug 1, 2012 · Viewed 20.3k times · Source

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

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

Answer

Johnny Rice picture Johnny Rice · Aug 2, 2012

You can specify request headers like this:

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