Raj*_*jju 5 rest firebase google-cloud-firestore
您知道如何使用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
Run Code Online (Sandbox Code Playgroud)
以及响应:
[{
"error": {
"code": 400,
"message": "Invalid value (Object), ",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"description": "Invalid value (Object), "
}
]
}
]
}
}
]
Run Code Online (Sandbox Code Playgroud)
最可能的是,我的请求正文无效。我使用了以下参考:https : //firebase.google.com/docs/reference/rest/firestore/v1beta1/projects.databases/listen
身体看起来如何?提前致谢。