Request Payload data in Sencha Touch

白昼怎懂夜的黑 提交于 2019-12-11 18:25:17

问题


Was just trying to sync a model in Sencha Touch and realised that it doesn't yet support sending of Nested Model data. So I'm having to do the Ajax request manually.

How can I send the data via 'Request Payload' instead of parameters etc?

Ext.Ajax.request({
        url: '/api/blah',
        method: 'POST',
        params: {
            request: toAdd,
        },
        success: function(response, opts) {

        },
        failure: function(response, opts) {

        }
    });

I'm guessing it has to be a particular header I send across?

Thanks, Dominic


回答1:


Ext.Ajax.request({
    url: '/api/blah',
    method: 'POST',
    jsonData: {
        //the object data etc,
    },
    success: function(response, opts) {

    },
    failure: function(response, opts) {

    }
});


来源:https://stackoverflow.com/questions/11610684/request-payload-data-in-sencha-touch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!