所以我正在尝试实施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 Conflict
{
"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."
}
}
有谁知道我做错了什么?