在 Sencha Touch 中请求 Payload 数据 [英] Request Payload data in Sencha Touch

查看:36
本文介绍了在 Sencha Touch 中请求 Payload 数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

刚刚尝试在 Sencha Touch 中同步模型,并意识到它尚不支持发送嵌套模型数据.所以我必须手动执行 Ajax 请求.

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?

谢谢,多米尼克

推荐答案

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

    },
    failure: function(response, opts) {

    }
});

这篇关于在 Sencha Touch 中请求 Payload 数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆