When using a store sync method is it possible to send custom headers to the server?
You can add extra headers to the underlying proxy which will be used when a sync
method is executed. For example you can configure your store like this:
Ext.define('MyStore', {
extend: 'Ext.data.Store',
model: 'MyModel',
proxy: {
type: 'rest',
headers: {'Content-Type': 'text/plain'}
url: '/api/v1...'
}
});
...and your model like this:
Ext.define('MyModel', {
extend: 'Ext.data.Model',
fields: ['id', 'name'],
proxy: {
type: 'rest',
headers: {'Content-Type': 'text/plain'}
url : '/api/v1...'
}
});