【发布时间】:2011-11-11 03:09:00
【问题描述】:
我正在尝试使用 POST 请求调用 API。但我的 Chrome Inspector 在网络选项卡中显示method='GET'...
这是我的代码:
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'
}
});
所以O想用method='POST'和参数operation = showall调用API
Google Inspector 在网络标签中向我显示以下信息:
GET ../path_to/api/?_dc=1315297478131&page=1&start=0&limit=25 HTTP/1.1
为什么是 GET 请求?
为什么会有limit、start、dc等参数?
我已经尝试了 1000 个教程,并在谷歌上搜索了一整晚。
【问题讨论】:
标签: javascript ajax json extjs extjs4