我正在尝试使用extjs代理 rest 访问 REST 服务,但是正在发送的 url 看起来很奇怪,看看:
/rest/v1/distribution-list/1* ?id=1 *
我不知道为什么要发送'id'。它应该发送'/rest/v1/distribution-list/1'
任何想法?这是我的模型
Ext.define('Wave.model.DistributionList', {
extend: 'Ext.data.Model',
fields: [
{name: 'id'},
{name: 'name', type: 'string'},
{name: 'status', type: 'string'}
],
proxy: {
type: 'rest',
noCache: false,
reader: {
type: 'json'
},
writer: {
type: 'json'
},
actionMethods: {
create: 'POST',
read: 'GET', // defaults to GET
update: 'POST',
destroy: 'DELETE'
},
api: {
read: '/rest/v1/distribution-list/',
create: '/rest/v1/distribution-list/',
update: '/rest/v1/distribution-list/',
destroy: '/rest/v1/distribution-list/'
}
}
});
干杯
- 恩里克