【问题标题】:Appcelerator framework handling JSON differently [duplicate]Appcelerator 框架以不同方式处理 JSON [重复]
【发布时间】:2012-12-08 02:25:52
【问题描述】:

Appcelerator 框架是否以不同的方式处理 JSON,或者我是否遗漏了一些简单的东西?

钛 json -

    var params = {
    user: {
        email: email.value,
        password: password.value
    },
    commit: "Sign In"
};

将此作为输出 -

 Parameters: {"user"=>"{email=123saurabhjain@gmail.com, password=96e79218965eb72c92a549dd5a330112}"}

但我需要这样的输出 -

Parameters: {"user"=>{"email"=>"abcdefgh@gmail.com", "password"=>
FILTERED]"}, "commit"=>"Sign in"}

在前一个输出中,

1) emailpassword 字段不在双引号中。

2) => 的赋值符号不会出现在 emailpassword 字段中。 相反,我得到了字段的 = 符号。

这是怎么回事,因为我的 json 似乎是正确的?

【问题讨论】:

    标签: json post titanium titanium-mobile


    【解决方案1】:

    试试这个:

    var params= {
        user: {
            email: email.value,
            password: password.value
        },
        commit: "Sign In"
    };
    

    然后像这样发送:

    loginReq.send(JSON.stringify(params));
    

    【讨论】:

      猜你喜欢
      • 2018-03-21
      • 2015-05-28
      • 1970-01-01
      • 1970-01-01
      • 2022-01-13
      • 2018-10-02
      • 1970-01-01
      • 2012-10-27
      • 2011-12-08
      相关资源
      最近更新 更多