gpt4 book ai didi

rest - Firestore REST API 数据库监听

转载 作者:行者123 更新时间:2023-12-02 01:26:02 25 4
gpt4 key购买 nike

您知道如何使用 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

body 应该是什么样子?提前致谢。

最佳答案

listen 方法无法通过 REST API 使用。可通过 RPC API 获取。 .

关于rest - Firestore REST API 数据库监听,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47203039/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com