alanuofm
6 Aug 2012, 11:10 AM
Hey folks,
I'm having an issue with a proxy post request payload that is always posting as a query string instead of a json string.
Here is what my model currently looks like with a specified proxy.
Ext.define('HL.store.FacetListTreeStore', { extend: 'Ext.data.TreeStore',
model: 'HL.model.FacetsTreeModel',
autoLoad: true,
proxy: {
type: 'ajax',
headers: {
'Content-Type': 'application/json; charset=UTF-8',
'Accept' : 'application/json, text/javascript, */*; q=0.01'
},
url: 'test.json',
reader: {
type: 'json',
root: 'ResultSet'
},
writer: {
type: 'json'
},
actionMethods: {
create: 'POST',
read: 'POST',
update: 'POST',
destroy: 'POST'
},
extraParams: {
recordOffset : "0",
rowsPerPage : "50"
}
}
});
The post request payload is always posting as
recordOffset=0&rowsPerPage=50
Any ideas on how to make it post as a json body such that it is {"recordOffset":0,"rowsPerPage":50}
Thanks,
Alan
I'm having an issue with a proxy post request payload that is always posting as a query string instead of a json string.
Here is what my model currently looks like with a specified proxy.
Ext.define('HL.store.FacetListTreeStore', { extend: 'Ext.data.TreeStore',
model: 'HL.model.FacetsTreeModel',
autoLoad: true,
proxy: {
type: 'ajax',
headers: {
'Content-Type': 'application/json; charset=UTF-8',
'Accept' : 'application/json, text/javascript, */*; q=0.01'
},
url: 'test.json',
reader: {
type: 'json',
root: 'ResultSet'
},
writer: {
type: 'json'
},
actionMethods: {
create: 'POST',
read: 'POST',
update: 'POST',
destroy: 'POST'
},
extraParams: {
recordOffset : "0",
rowsPerPage : "50"
}
}
});
The post request payload is always posting as
recordOffset=0&rowsPerPage=50
Any ideas on how to make it post as a json body such that it is {"recordOffset":0,"rowsPerPage":50}
Thanks,
Alan