brase
(Sebastian Brandt)
1
你好,
我正在尝试通过 API 触发 Discourse 的备份创建。
我注意到一个奇怪的现象:通过 API 触发的备份似乎不包含上传文件。通过 API 触发的备份大小为 140MB,而通过“备份”按钮触发的备份大小为 330MB。
我使用以下命令触发备份:
curl -XPOST -H 'Content-Type: application/json' "https://talk.rhein-spree.com/admin/backups.json?api_key=mykey&api_username=sebastian" -d '{ "with_uploads": true }'
是我操作有误,还是通过 API 触发的备份存在 bug?
gerhard
(Gerhard Schlager)
2
You should send it as form data instead of JSON. That works.
curl --request POST \
--url http://example.com/admin/backups.json \
--header 'content-type: application/x-www-form-urlencoded' \
--data 'api_key=<api_key>&api_username=<username>&with_uploads=true'