【发布时间】: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