【问题标题】:Error when updating APIGEE Entities更新 APIGEE 实体时出错
【发布时间】:2014-10-13 12:19:15
【问题描述】:

我目前正在开发一个实现 apigee 的应用程序,但是,我在尝试更新实体时遇到了一个问题。以下是我目前正在使用的方法。

            Map<String, Object> updatedEntity = new HashMap<String, Object>();
            ArrayList<Map<String,Object>> subPropertyArray = new ArrayList<Map<String,Object>>();
            Map<String, Object> subProperty = new HashMap<String, Object>();

            subProperty.put("age", "");
            subProperty.put("auto_checkin_times", auto_checkin_times);
            subProperty.put("auto_checkins_enabled", "on");
            subProperty.put("bio", "");
            subProperty.put("max_age", "999");
            subProperty.put("min_age","18");
            subProperty.put("dob", mDob);
            subProperty.put("locale","");
            subProperty.put("sex", mGender);
            subProperty.put("sexual_preference", mSexualPreference);
            subProperty.put("utc_offset","");
            subPropertyArray.add(subProperty);


            updatedEntity.put("type", "user");
            updatedEntity.put("info", subPropertyArray);

            dataClient.updateEntityAsync(entityID, updatedEntity, new ApiResponseCallback() {
                @Override
                public void onResponse(ApiResponse apiResponse) {
                    if (apiResponse != null) {
                            Intent intent = new Intent(SetupPage.this, HomePage.class);
                            startActivity(intent);
                    }
                }

                @Override
                public void onException(Exception e) {
                    Log.e("", e.toString());
                }
            });

但是我收到以下错误:

“错误 PUT 到 'https://api.usergrid.com/ORGNAME/APPNAME/user/USERID

后跟:

“未找到身份验证挑战”

“doHttpRequest 返回 null”

我们将不胜感激。 谢谢

【问题讨论】:

  • 尝试 /users 而不是 /user 哦,没关系,它们是可以互换的。嗯
  • 这也是我脑海中闪现的第一件事!但是是的,你是正确的。

标签: java android asynchronous android-asynctask apigee


【解决方案1】:

您是否在请求中发送令牌? “未找到身份验证挑战”错误让我认为您可能将令牌传递给不需要它的端点(例如默认沙盒应用程序),或者将无效令牌与请求一起传递。

【讨论】:

    【解决方案2】:

    我应该早点回复 got his,但是,问题似乎归结为多个问题,entityid 略有错误,我发布的数据格式不正确。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-02-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-06
      • 2015-08-29
      相关资源
      最近更新 更多