【问题标题】:How to do a post request with parameters passed in Sencha touch2.2?Sencha touch2.2中传参数的post请求怎么做?
【发布时间】:2013-09-02 11:53:29
【问题描述】:

我正在尝试使用需要一些参数的 Sencha Architect 进行 POST 请求。我在额外的参数中给出了它。但是当我在存储中加载数据时,它说方法不允许(错误 405)。我的商店是

config: {
        autoLoad: true,
        model: 'MyApp.model.MyModel',
        storeId: 'MyJsonPStore',
        proxy: {
            type: 'rest',
            extraParams: {
                credentials: {
                    password: 'XXX',
                    ipAddress: '000.0.0.0',
                    deviceType: 'ZZZ',
                    username: 'ABCD',
                    clientVersion: '2.0.0.0',
                    clientHelpVersion: null
                }
            },
            url: 'http://abcd.com/login/',
            reader: {
                type: 'json',
                rootProperty: 'userLogin'
            }
        }

【问题讨论】:

    标签: json rest extjs sencha-touch http-post


    【解决方案1】:

    您可以在商店中使用“actionMetods”强制请求方法:

    (设置代理、api、编写器等...并添加:)

    actionMethods:  
        {
            create: 'POST', 
            read: 'POST',
            update: 'POST',
            destroy: 'POST'
        },
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-01-17
    • 2014-01-26
    • 1970-01-01
    • 1970-01-01
    • 2023-03-23
    • 1970-01-01
    • 2016-12-31
    相关资源
    最近更新 更多