1

所以我正在尝试实现 google appstate 云保存功能来保存字符串(https://developers.google.com/games/services/web/api/states),但我收到 409 冲突错误。我一定是用错了。有人有 JavaScript 实现的例子吗?这就是我要做的事情:

GET https://www.googleapis.com/appstate/v1/states

返回:

{
 "kind": "appstate#listResponse",
 "maximumKeyCount": 4,
 "items": [
  {
   "kind": "appstate#getResponse",
   "stateKey": 0,
   "currentStateVersion": "CNDVopDDwLgC"
  }
 ]
}

然后我

PUT https://www.googleapis.com/appstate/v1/states/0

与身体:

{

currentVersion: "CNDVopDDwLgC"
data: "some data"
kind: "appstate#updateRequest"

}

这给出了错误:409冲突

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "OutOfDateVersion",
    "message": "The resource version you are attempting to modify does not match the current version on the server."
   }
  ],
  "code": 409,
  "message": "The resource version you are attempting to modify does not match the current version on the server."
 }
}

有谁知道我做错了什么?

4

0 回答 0