您知道如何使用REST API设置Firestore监听。这是我的尝试:
url: "https://firestore.googleapis.com/v1beta1/projects/project_name/databases/(default)/documents:listen"
headers: {["Content-Type"] = "application/json"}
body: "{"addTarget": {
"once" : false,
"documents" : {
"documents" : [ "projects/project_name/databases/(default)/documents/Users/USER_DOC_ID" ]
}
}}"
Request verb: POST
回复:
[{
"error": {
"code": 400,
"message": "Invalid value (Object), ",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"description": "Invalid value (Object), "
}
]
}
]
}
}
]
最可能的是,我的请求正文无效。我使用了这个参考:https://firebase.google.com/docs/reference/rest/firestore/v1beta1/projects.databases/listen
身体应该如何? 提前致谢。