您好,我是Sencha touch2的新手,在從遠程url獲取數據時遇到問題。當我在簡單的休息客戶端中使用url時,我可以獲取數據和狀態:200好。這裏是簡單的休息客戶端的輸入供您參考。Sencha touch2:爲Json數據創建Ajax發佈請求
---------------
url: http://190.40.2.14:9030/work
Method: post
Headers:Accept: application/json
Data:<workTO><platform>ALL</platform></workTO>
---------------
如何使用POST請求,頭部和數據我怎麼能做到這一點的煎茶touch2。
這裏是代理模式:
Ext.define('TestApp.model.myModel', {
extend: 'Ext.data.Model',
xtype:'modelList',
config: {
fields:['work'],
proxy:{
type:'rest',
// url:'http://localhost:9090/TestApp/app/store/sample.json',// this works
url:'http://10.30.2.141:9030/work',
reader:
{
type:'json'
}
}
}
});
你不能使用JsonP發送POST請求。 – 1Mayur 2013-04-08 15:04:43
你能提供一下如何做的代碼嗎? – chipmunk 2013-04-08 15:38:03