Próbuję wywołać API z żądaniem POST. Ale moja Chrome Inspector pokazuje mi method='GET'
na karcie sieciowej ...ExtJS 4 - Problemy z JsonStore + Post Request
Oto mój kod:
Ext.define('TestItem', {
extend: 'Ext.data.Model',
fields: [
{name: 'id', type: 'int'},
{name: 'name', type: 'string'}
]
});
var testStore = Ext.create('Ext.data.JsonStore', {
model: 'TestItem',
autoLoad: true,
proxy: {
type: 'ajax',
url : '../path_to/api/',
method : 'POST',
reader: {
type: 'json',
root: 'data',
totalProperty: 'total'
}
},
baseParams: {
operation:'showall'
}
});
Więc O chcesz zadzwonić API z method='POST'
i parametru operation = showall
pokazy Google Inspector mi w zakładce sieci następujące informacje:
GET ../path_to/api/?_dc=1315297478131&page=1&start=0&limit=25 HTTP/1.1
Dlaczego jest to żądanie GET?
Dlaczego istnieją niektóre parametry, takie jak limit, start i dc?
Już wypróbowałem 1000 tutoriali i googled przez całą noc.
ewentualne duplikaty [dodaje, przechowują extjs4 uzyskać params w URL] (http://stackoverflow.com/questions/6925081/extjs4-store-addes-get-params-in-the-url/6926857#6926857) –