我在 firebase rest api 教程中运行示例代码。上面写着
Data from our Firebase database can be read by issuing an HTTP GET request to an endpoint:
curl 'https://samplechat.firebaseio-demo.com/users/jack/name.json'
A successful request will be indicated by a 200 OK HTTP status code. The response will contain the data being retrieved:
{ "first": "Jack", "last": "Sparrow"
}
我的结果在这里:
现在我尝试使用以下命令写入 firebase 数据库
curl -X PUT -d '{ "last": "sparrow"}' https://samplechat.firebaseio-demo.com/users/jack/name.json
我该如何解决?
最佳答案
请尝试:
curl -X PUT -d "{\"name\":{\"last\": \"sparrow\"}}" https://samplechat.firebaseio-demo.com/users/jack.json
这对我适用于 Windows。
关于json - Firebase - 如何使用 curl 编写?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35793426/